第一题A了 第二题0 dic = {1: 1, 2: 5, 3: 8, 4: 7, 5: 2, 6: 9, 7: 4, 8: 3, 9: 6} N = int(input().strip()) for _ in range(N): in_list = list(map(lambda x: int(x), [_ for _ in input()])) t_list = list(map(lambda i: dic[i], in_list)) re_list = in_list[::-1] if re_list == t_list: print("YES") else: print("NO")