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