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