#include <bits/stdc++.h>
using namespace std;
long long fastpow(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % 1000000009;
    base = (base * base) % 1000000009;
    exp /= 2;
  }
  return res % 1000000009;
}
bool sortbysec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (abs(a.first - a.second) > abs(b.first - b.second));
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long a, m;
  cin >> a >> m;
  long long ans = 0;
  while (ans <= 20) {
    if ((a % m) == 0) {
      cout << "Yes";
      return 0;
    }
    a = a * 2;
    ans++;
  }
  cout << "No";
  return 0;
}
