#include<stdio.h>

int main(){

         int n,a[100];

    scanf("%d",&n);

         for(int i=0;i<n;i++)

         scanf("%d",a[i]);     

         int flag,x=0,y=0;

         if(a[0]>'a'&&a[0]<'z'||a[0]>'A'&&a[0]<'Z'||a[0]=='_'){

                   for(int j=1;j<n;j++){

                            if(a[j]>'a'&&a[j]<'z'||a[j]>'A'&&a[j]<'Z'||a[j]=='_'||a[j]>'0'&&a[j]<'9')x++;

                       else y++;}

         if(y>0)printf("NO\n");

         else printf("YES\n");}

         else printf("NO\n");

         return 0;

}