On the way to Dandi March, Gandhijee carried a mirror with himself. When he reached Dandi, he decided to play a game with the tired people to give them some strength. At each turn of the game he pointed out a person and told him to say a number N(possibly huge) of his choice. The number was called lucky if that equals it's mirror image.

Input: 
First line contains number of test cases T. Each test case contains a single integer N.

Output: 
For each test case print "YES" if the number was lucky else print "NO" (quotes for clarity) in one line.

Constraints:
1 ≤ T ≤ 100
0 ≤ N ≤ 10^100Image for Sample Test Cases :SAMPLE INPUT
2
101
020

SAMPLE OUTPUT
YES
NO

Explanation

For 1st case, as clear from the image "101" and it's mirror image are identical. Hence, output "YES".
For 2nd case, "020" and it's mirror image are not identical. Hence output "NO".
t=int(raw_input())
for i in range(t):
	a=raw_input()
	if(a[::-1]!=a):
		print "NO"
	elif(('2'in a)or('3'in a)or('4'in a)or('5'in a)or('6'in a)or('7'in a)or('9'in a)):
			print "NO"
	else:
		print "YES"