def divide_2(n): if n == 0: return 0 else: if n == 1: return 0 else: a = format(n,'b') if a.count("1") == 1: return 1 else: return 0 T = int(input()) for i in range(T): x = int(input()) if divide_2(x) == 1: print("Y") else: print("N")