#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, m;
  cin >> a >> m;
  for (int i = 0; i < m; i++) {
    if (a % m == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    a = a + a % m;
  }
  cout << "No" << endl;
}
