It is a very well-known fact that Bayview Computer Club currently has exactly eleven
rhymes with seven
.
Inspired by this, you have devised a set of rules for whether two numbers rhyme or not:
- one of the numbers ends in
- the other number ends in
- neither number ends in
For two numbers to rhyme, all three conditions must be satisfied.
Given
Constraints
Input Specification
The first line contains a single integer,
The next
Output Specification
For each of the YES
if the numbers rhyme, or NO
otherwise.
Sample Input
Copy
5
7 11
11 14
19511 8247
311 6817
7 7
Sample Output
Copy
YES
NO
YES
NO
NO
Comments