import java.util.Scanner;
public class Main {
public static void main(String []args) {
@SuppressWarnings("resource")
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
int n = in.nextInt();
in.nextLine(); //清除缓冲区中nextInt()留下的换行符;
for(int i=0;i<n;i++) {
String s = in.nextLine(); //读取换行符
LegalTag(s);
}
}
}
public static void LegalTag(String s) {
if((s.charAt(0)>='A' && s.charAt(0)<='Z') || (s.charAt(0)>='a' && s.charAt(0)<='z') || s.charAt(0)=='_') {
boolean flag= false ;
for(int j=1;j<s.length();j++) {
if(!((s.charAt(j)>='0'&&s.charAt(j)<='9')||(s.charAt(j)>='A'&&s.charAt(j)<='Z')||(s.charAt(j)>='a'&&s.charAt(j)<='z')||s.charAt(j)=='_')){
flag = true;
break;
}
}
if(flag == true){
System.out.println("no");
}else{
System.out.println("yes");
}
}else{
System.out.println("no");
}
}
}