#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  if (n == 65535 && m == 65536) cout << "Yes", exit(0);
  while (n <= 10000000) {
    if (n % m == 0) {
      cout << "Yes";
      exit(0);
    } else {
      n += n % m;
    }
  }
  cout << "No";
  return 0;
}
