Source Code
it=int(input())
alphabet="ABCDEFGHIJKLM"
for i in range(it):
    a =input()
    a= ''.join(sorted(a))
    if a in alphabet:
        print("YES")
    else:
        print("NO")
Copy
Well-indexed? azoz1111111
Python 3
136 ms
3.2 MB
Accepted