#include<bits/stdc++.h>
using namespace std;
int main(){
long long int num,temp,n=0,check=0;
cin>>num;
temp=num;
while(temp){
n++;
temp=temp/10;
}
temp=num;
while(temp){
int remainder=temp%10;
temp=temp/10;
int toadd=1;
for(int i=0;i<n;i++){
toadd*=remainder;
}
check+=toadd;
}
if(check==num){
cout<<"True"<<endl;
}
else{
cout<<"False"<<endl;
}
return 0;
}