#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t, n;
  cin >> t;
  bool flag = 0, flag2 = 0, flag3 = 0;
  for (long long int i = (long long int)9; i >= (long long int)1; i--) {
    if (t % i == 0) {
      t /= i;
      flag3 = 1;
      break;
    }
  }
  for (long long int i = (long long int)9; i >= (long long int)1; i--) {
    if (t % i == 0) {
      t /= i;
      flag2 = 1;
      break;
    }
  }
  if (flag3 == 0 || flag2 == 0) flag = 1;
  if (t != 1)
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
