#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, m;
  cin >> a >> m;
  bool flag = false;
  int t = m;
  while (t--) {
    if ((a + a % m) % m == 0) {
      flag = true;
    } else {
      a = (a + a % m) % m;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
