#include<bits/stdc++.h>
using namespace std;
int main(){
int i,n;
string s;
cin>>n;
while(n--){
int c=0;
cin>>s;
if(s[0]=='Y'||s[0]=='y'){
c++;
}
if(s[1]=='E'||s[1]=='e'){
c++;
}
if(s[2]=='S'||s[2]=='s'){
c++;
}
if(c==3){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
}
return 0;
}