#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
 
  set<ll> se;
  for(ll i=0;i<1000000;i++){
    se.insert(i*i%1000000);
  }
  
  int s;
  cin>>s;
  if(se.count(s)) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  
  return 0;
}