#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void magic() {
string s; cin>>s;
bool found = true;
for(char i = 'A' ; i<='M' ; i++){
if(s.find(i) == s.npos){
found = false;
break;
}
}
if(found){
cout<<"YES\n";
}
else cout<<"NO\n";
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
//freopen("intput.in", "r", stdin); // INPUT
// freopen("road.out", "w", stdout); // OUTPUT JUST IN CASE
int tt = 1; cin>>tt;
while (tt--)
magic();
}