import java.util.Arrays;
import java.util.Scanner;
public class StoneDivision {
public static void main
(String[] args
) { Scanner scan
= new Scanner
(System.
in);
long n = scan.nextLong();
int m = scan.nextInt();
long si[] = new long[m];
for (int i = 0; i < m; i++) {
si[i] = scan.nextLong();
}
if (calculateWin(n, m, si, si.length - 1, 1)) {
} else {
}
}
static boolean calculateWin(long n, int m, long[] si, int siIndex, int count) {
long siN = si[siIndex];
if (n / siN == 0)
return true;
if (n == 1)
if (n % siN == 0) {
long nN = n / siN;
count++;
}
return calculateWin(n, m, si, siIndex - 1, count);
}
}
aW1wb3J0IGphdmEudXRpbC5BcnJheXM7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKCnB1YmxpYyBjbGFzcyBTdG9uZURpdmlzaW9uIHsKCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CgkJU2Nhbm5lciBzY2FuID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCgkJbG9uZyBuID0gc2Nhbi5uZXh0TG9uZygpOwoJCWludCBtID0gc2Nhbi5uZXh0SW50KCk7CgkJbG9uZyBzaVtdID0gbmV3IGxvbmdbbV07CgoJCWZvciAoaW50IGkgPSAwOyBpIDwgbTsgaSsrKSB7CgkJCXNpW2ldID0gc2Nhbi5uZXh0TG9uZygpOwoJCX0KCgkJQXJyYXlzLnNvcnQoc2kpOwoKCQlpZiAoY2FsY3VsYXRlV2luKG4sIG0sIHNpLCBzaS5sZW5ndGggLSAxLCAxKSkgewoJCQlTeXN0ZW0ub3V0LnByaW50bG4oIkZpcnN0Iik7CgkJfSBlbHNlIHsKCQkJU3lzdGVtLm91dC5wcmludGxuKCJTZWNvbmQiKTsKCQl9Cgl9CgoJc3RhdGljIGJvb2xlYW4gY2FsY3VsYXRlV2luKGxvbmcgbiwgaW50IG0sIGxvbmdbXSBzaSwgaW50IHNpSW5kZXgsIGludCBjb3VudCkgewoKCQlsb25nIHNpTiA9IHNpW3NpSW5kZXhdO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