#include <bits/stdc++.h>
using namespace std;
const int MAX = 2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,
      v, w, x, y, z;
  long long int tc;
  cin >> n >> m;
  while (m % 2 == 0) {
    m /= 2;
  }
  if (n % m == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
