#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline T cube(T x) {
  return x * x * x;
}
template <class T>
inline T powr(T x, T y) {
  T ret = 1;
  while (y--) ret *= x;
  return ret;
}
template <class T>
inline T mod(T a, T b) {
  return (a % b + b) % b;
}
template <class T>
inline T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (b == 0) ? a : GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return a * (b / GCD(a, b));
}
template <class T>
inline bool isPrime(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline void debug(T x) {
  cout << "x = " << x << endl;
}
template <class T1, class T2>
inline void debug(T1 x, T2 y) {
  cout << "x = " << x << ", y = " << y << endl;
}
template <class T1, class T2, class T3>
inline void debug(T1 x, T2 y, T3 z) {
  cout << "x = " << x << ", y = " << y << ", z = " << z << endl;
}
int dx[] = {+1, -1, +0, +0};
int dy[] = {+0, +0, +1, -1};
int ck[1000001] = {0};
int main() {
  int a, n;
  cin >> a >> n;
  int f = 0, x;
  for (;;) {
    x = a % n;
    if (!x) break;
    if (ck[x]) {
      f = 1;
      break;
    } else {
      ck[x] = 1;
      a += x;
    }
  }
  if (f)
    printf("No");
  else
    printf("Yes");
  printf("\n");
  return 0;
}
