#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  for (int i = 1; i <= 9; i++) {
    long long x;
    if (n % i == 0) x = n / i;
    for (int j = 1; j <= 9; j++) {
      if (x % i == 0) {
        x = x / i;
        if (x == 1) {
          cout << "Yes";
          exit(0);
        }
      }
    }
  }
  cout << "No";
}
