#include <bits/stdc++.h>
using namespace std;
int main() {
  long long start, m;
  bool answer = false;
  cin >> start >> m;
  for (int day = 0; day < 100000; ++day) {
    if ((start % m) == 0) {
      answer = true;
      break;
    }
    start += (start % m);
  }
  if (answer)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
