#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int x, m, sum = 0;
  cin >> x >> m;
  for (int i = 0; i < 100004; i++) {
    x += (x % m);
    if (x % m == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
