#include <bits/stdc++.h>
using LL = long long;
using ULL = unsigned long long;
using namespace std;
int main() {
  int a, b, sum;
  vector<int> array;
  cin >> a >> b;
  if (b / 100 >= 1) {
    sum = a * 1000 + b;
  } else if (b / 10 >= 1) {
    sum = a * 100 + b;
  } else {
    sum = a * 10 + b;
  }
  for (int i = 2; (i ^ 2) < sum; i++) {
    int j = 0;
    while (sum % i == 0) {
      sum /= i;
      j++;
    }
    for (int k = 0; k < j; k++) {
      array.emplace_back(i);
    }
  }
  int count = 1;
  for (size_t i = 0; (i + 1) < array.size(); i++) {
    if (array[i] == array[i + 1]) {
      count++;
    } else {
      if (count % 2 != 0 || count == 0) {
        cout << "No" << endl;
        return 0;
      }
      count = 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
