#include <bits/stdc++.h>
using namespace std;
int a, m, x;
int ar[100010];
int main() {
  scanf("%d %d", &a, &m);
  x = a;
  while (ar[x] == 0) {
    ar[x] = 1;
    if (x % m == 0) {
      puts("Yes");
      return 0;
    }
    x += x % m;
    x = x % m;
  }
  puts("No");
}
