#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
bool rec(int a, int b) {
  if (m.count(a % b) > 0) return false;
  m[a % b] = 1;
  if (a % b == 0)
    return true;
  else {
    return rec(a + a % b, b);
  }
}
int main() {
  int a, b;
  cin >> a >> b;
  int x;
  if (rec(a, b))
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
