#include <bits/stdc++.h>
using namespace std;
int a[1000002];
int main() {
  long long n, m;
  cin >> n >> m;
  memset(a, 0, sizeof(a));
  bool flag = 0;
  while (n) {
    if (n % m == 0) {
      flag = 1;
      break;
    }
    n = n + n % m;
    if (a[n % m] == 1) break;
    a[n % m] = 1;
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
