#include<stdio.h>
int main () {
int a,b,c,d;
while ( scanf("%d",&a)) {
b = a%10;
c = a%100/10;
d = a/100;
if (a==0){
break;}
else
{
if ((b*b*b+c*c*c+d*d*d)==a)
printf ("Yes\n");
else
printf ("No\n");
}}
return 0;
}
int main () {
int a,b,c,d;
while ( scanf("%d",&a)) {
b = a%10;
c = a%100/10;
d = a/100;
if (a==0){
break;}
else
{
if ((b*b*b+c*c*c+d*d*d)==a)
printf ("Yes\n");
else
printf ("No\n");
}}
return 0;
}