Woohyun has positive integers. Let denote the -th integer.
To investigate the relationships between these integers, Woohyun constructs an undirected graph with vertices. Vertex corresponds to the integer .
For two distinct vertices and , an edge connects them if and only if .
You are given queries. For each query, determine whether it is possible to reach vertex from vertex by following edges of the graph. If , the destination is considered reachable without traversing any edge.
The input is given in the following format:
For each query, print YES if the destination is reachable, or NO otherwise, on a separate line.
Vertices and are directly connected. Vertices and have no edges to other vertices. A query from a vertex to itself always has answer YES.
Vertex is reachable from vertex through vertex . Vertex has no edges to other vertices.
The -th query asks whether vertex is reachable from vertex .