#include <bits/stdc++.h>
const long long mod = 998244353;
const long long n = 100005;
const double EPS = 1e-9;
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  if (k == 1 || n % k == 0)
    cout << "Yes";
  else {
    long long f = 0, temp = n;
    if (temp > k) temp %= k;
    long long a = 1;
    for (long long i = 0; i < 20; i++) {
      if ((a * temp) % k == 0) {
        f = 1;
        break;
      }
      a *= 2;
    }
    if (f)
      cout << "Yes";
    else
      cout << "No";
  }
  return 0;
}
