#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long f = 1;
  for (long long i = 0; i < 100000; i++) {
    n += (n % m);
    if (n % m == 0) {
      f = 0;
      break;
    }
  }
  if (!f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
