#include <bits/stdc++.h>
using namespace std;
int dau[100010];
int m, x;
bool kt() {
  while (dau[m] != 1) {
    dau[m] = 1;
    if (m % x == 0) return true;
    m = (m + m % x) % x;
  }
  return false;
}
int main() {
  scanf("%d%d", &m, &x);
  if (kt())
    cout << "Yes";
  else
    cout << "No";
  fclose(stdin);
  fclose(stdout);
}
