#include <bits/stdc++.h>
using namespace std;
long long n, m, j, k, i, l, a;
int A[2000005];
int main() {
  scanf("%lld %lld", &a, &n);
  while (1) {
    if (a % n == 0) return cout << "Yes", 0;
    a += a % n;
    a %= n;
    if (A[a]) return cout << "No", 0;
    A[a] = 1;
  }
  return 0;
}
