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