#include <bits/extc++.h>
using namespace std;
using ll = long long;
#define REP(i,n) for(int i=0;i<int(n);i++)
#define FOR(i,a,b) for(int i=a;i<=int(b);i++)
#define ALL(x) x.begin(),x.end()
#define INFL LLONG_MAX

signed main() {
  string s;
  cin >> s;
  for(ll i=1; i<=2e6; i++) {
    ll ch = i*i;
    if(ch < 1e6) continue;
    bool ok = true;
    REP(j, 6) {
      if(ch % 10 != s[5-j] - '0') ok = false;
      ch /= 10;
    }
    if(ok) {
      cout << "YES";
      return 0;
    }

  }
  cout << "NO";
  return 0;
}