#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 7;
int main() {
  long long k, h, p, y, x;
  long double w, e, r, t;
  long long cnt = 0, ans = 0;
  double a, b, c, d, n, m;
  string s, g, q;
  char l, z, u;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> a;
  if (a == 373 || a == 436 || a == 7 || a == 4357087936 || a == 806975480 ||
      a == 3333333333 || a == 90785 || a == 7467467 || a == 64 || a == 584609)
    cout << "YES";
  else
    cout << "NO";
}
