#include int main () { char s[7] = ""; int res = 0; long long rem = 0LL; int is_ok = 0; res = scanf("%s", s); for (int i = 0; i < 6; i++) { rem *= 10LL; rem += (long long) (s[i]-'0'); } for (long long i = 0LL; i < 1000000LL; i += 1LL) { if ((i*i)%1000000LL == rem) { is_ok = 1; } } if (is_ok > 0) { printf("YES\n"); } else { printf("NO\n"); } return 0; }