#include using namespace std; int main(){ string S; cin >> S; int A = stoi(S); bool ok = false; for (int i = 0; i < 1000000; i++){ if ((long long) i * i % 1000000 == A){ ok = true; } } if (ok){ cout << "YES" << endl; } else { cout << "NO" << endl; } }