#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, m, acum;
  scanf("%d %d", &a, &m);
  acum = a;
  int day = 0;
  while (day < 20) {
    day++;
    acum += acum % m;
    if (acum % m == 0) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
}
