#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 1e6 + 5;
int32_t main() {
  long long a, m;
  cin >> a >> m;
  for (long long i = 0; pow(2, i) <= 100005; i++) {
    long long x = a * (pow(2, i));
    if (x % m == 0) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}
