it=int(input()) for i in range(it): a =input() a= ''.join(sorted(a)) if ord(a[len(a)-1])>=77: print("YES") else: print("NO")