def solve(): x = int(input()) if x in [0, 45]: print("Y") else: print("N") t = int(input()) for i in range(t): solve()