def main(): import sys input = sys.stdin.readline for _ in range(int(input())): x = int(input()) if x == 45 or x == 0: print('Y') else: print('N') if __name__ == '__main__': main()