#include
#define max 100using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {int n, i, a[max], sum = 0, size = 0;cin>>n;for (i=0;i>a[i]; sum += a[i] * a[i];}while (sum>0){ sum/=10; size++;}if (size == 5) cout<<"YES";else cout<<"NO";return 0;}