#include <bits/stdc++.h>
using namespace std;
const int N = 111111;
const int INF = 1000000000, mod = 1000000007;
const long long LLINF = 1000000000000000000ll;
bool used[N];
int main() {
  long long fst, x, y;
  cin >> x >> y;
  if (x % y == 0) {
    cout << "Yes";
    return 0;
  }
  while (!used[x % y]) {
    used[x % y] = 1;
    x += x % y;
    if (x % y == 0) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
  return 0;
}
