#include <bits/stdc++.h>
const int M = 1e5 + 10;
using namespace std;
int main() {
  long long a, m;
  while (cin >> a >> m) {
    int t = 0, ok = 1;
    while (t < m) {
      a += a % m;
      if (a % m == 0) {
        printf("Yes\n");
        ok = 0;
        break;
      }
      t++;
    }
    if (ok) printf("No\n");
  }
  return 0;
}
