#include <algorithm>
#include <functional>
#include <iostream>
#include <numeric>
#include <random>
#include <string>
#include <vector>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
sort(s.begin(), s.end());
cout << (s == "ABCDEFGHIJKLM" ? "YES" : "NO") << endl;
}
return 0;
}