#include<cstdio>
#include<cstring>
#include<iostream>
char str[300];
using namespace std;
int main()
{
bool b;
char *p;
int n;
cin>>n;
cin.get();
while(n--)
{
cin.getline(str,300);
b=true;
if('0'<=str[0]&&str[0]<='9')
b&=false;
for(p=str;*p;p++)
b&=(*p>='a'&&*p<='z'||*p>='A'&&*p<='Z'||*p=='_'||*p>='0'&&*p<='9');
if(b)printf("yes\n");
else printf("no\n");
}
return 0;
}