#include <iostream>
#include <vector>
using namespace std;
int main() {
int n,k;
cin >> n >> k;
vector<int> p(k);
for(auto &pi: p) {
cin >> pi;
}
for(const auto pi: p) {
while (n%pi == 0) {
n /= pi;
}
}
if (n == 1) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}