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