#P1491D. Zookeeper and The Infinite Zoo
Zookeeper and The Infinite Zoo
No submission language available for this problem.
Description
There is a new attraction in Singapore Zoo: The Infinite Zoo.
The Infinite Zoo can be represented by a graph with an infinite number of vertices labeled . There is a directed edge from vertex to vertex if and only if , where denotes the bitwise AND operation. There are no other edges in the graph.
Zookeeper has queries. In the -th query she will ask you if she can travel from vertex to vertex by going through directed edges.
The first line contains an integer () — the number of queries.
The -th of the next lines will contain two integers , () — a query made by Zookeeper.
For the -th of the queries, output "YES" in a single line if Zookeeper can travel from vertex to vertex . Otherwise, output "NO".
You can print your answer in any case. For example, if the answer is "YES", then the output "Yes" or "yeS" will also be considered as correct answer.
Input
The first line contains an integer () — the number of queries.
The -th of the next lines will contain two integers , () — a query made by Zookeeper.
Output
For the -th of the queries, output "YES" in a single line if Zookeeper can travel from vertex to vertex . Otherwise, output "NO".
You can print your answer in any case. For example, if the answer is "YES", then the output "Yes" or "yeS" will also be considered as correct answer.
Samples
Note
The subgraph on vertices is shown below.
