#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  cin >> x >> y;
  int i = 0;
  x %= y;
  while (x && i < 20) {
    x += x;
    x %= y;
    i++;
  }
  if (x == 0) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
