#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int c = b;
  int count = 0;
  while (b) {
    count++;
    b /= 10;
  }
  for (int i = 0; i < count; i++) {
    a *= 10;
  }
  c += a;
  for (int i = 1; i * i <= c; i++) {
    if (c % i == 0 && c / i == i) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
