#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines T, *X = int(readline()) def solve(x): if x in [0, 45]: return 'Y' else: return 'N' print('\n'.join(map(solve, X)))