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