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