#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, m, i, j;
  cin >> a >> m;
  for (i = 1; i <= 100000; i++) {
    j = a + (a % m);
    if (j % m == 0) {
      cout << "Yes\n";
      return 0;
    }
    a = j;
  }
  cout << "No\n";
  return 0;
}
