#include <bits/stdc++.h>
int main() {
  long long a, m, c, i;
  scanf("%I64d %I64d", &a, &m);
  for (i = 0; i <= 700; i++) {
    c = a % m;
    if (c == 0) break;
    a = a + c;
  }
  if (c == 0) {
    printf("Yes");
  } else
    printf("No");
  return 0;
}
