#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;
int main() {
int n;
cin >> n;
string indexed = "ABCDEFGHIJKLM";
while (n--) {
string s;
cin >> s;
sort(s.begin(), s.end());
if (s == indexed)
cout << "YES" << endl;
else
cout << "NO\n";
}
return 0;
}