#include<stdio.h>
#include<string.h>
int main()
{
int n;
int i;
while(scanf("%d%*c",&n)!=EOF)
{
while(n--) //for(i=0;i<n;i++)则Wrong Answer
{
char str[51];
//memset(str,'\0',sizeof(str));
gets(str); //scanf("%s",str) 则 Output Limit Exceeded
if(str[0]=='_'||(str[0]<='z'&&str[0]>='a')||(str[0]<='Z'&&str[0]>='A'))
{
int len,flag=1;
len=strlen(str);
for(i=0;i<len;i++)
{
if(str[i]=='_'||(str[i]<='z'&&str[i]>='a')||(str[i]<='Z'&&str[i]>='A')||(str[i]<='9'&&str[i]>='0'))
continue;
else
{
flag=0;
break;
}
}
if(flag)
printf("yes\n");
else
printf("no\n");
}
else
printf("no\n");
}
}
return 0;
}