Mirror of Mahatma Gandhi
Practice
3.6 (45 votes)
Ad Hoc
Approved
Easy
Open
Problem
34% Success 19319 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

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 ≤ 10100

Image for Sample Test Cases :

enter image description here

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
29 votes
Tags:
AlgorithmsApprovedImplementationMediumOpenTrees
Points:20
13 votes
Tags:
AlgorithmsStringBasics of String ManipulationImplementationString AlgorithmsSets
Points:20
45 votes
Tags:
Ad-HocApprovedEasyImplementationOpen