#include <bits/stdc++.h>
using namespace std;
long long int f[100005];
int main() {
  long long a, m, i, sum = 0;
  cin >> a >> m;
  int flag = 0;
  while (1) {
    if (a % m == 0) {
      flag = 1;
      break;
    } else {
      long long temp = a % m;
      if (f[temp] == 1) {
        flag = 0;
        break;
      } else {
        f[temp] = 1;
        a += temp;
      }
    }
  }
  if (flag)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
