P8845 [Chuanzhi Cup #4 Preliminary] Xiaoka and Prime Numbers

Background

Xiaoka has recently become obsessed with prime numbers, so he came up with a problem related to primes to test you. A prime number is a natural number greater than $1$ that has no divisors other than $1$ and itself.

Description

Xiaoka has $T(1\le T\le 10^5)$ queries. In each query, you are given two positive integers $x,y(1\le x,y\le 10^9)$. Xiaoka wants to know whether the $x$-th prime number and the $y$-th prime number satisfy $p_x \oplus p_y = 1$, that is, whether the XOR value of the $x$-th prime and the $y$-th prime is $1$.

Input Format

The first line contains a positive integer $T$, representing the number of queries. The next $T$ lines each contain two positive integers $x,y$, representing a query about the $x$-th prime number and the $y$-th prime number.

Output Format

Output $T$ lines. Each line contains a string `Yes` or `No`, indicating whether the XOR value of the two prime numbers is $1$ or not $1$, respectively.

Explanation/Hint

Translated by ChatGPT 5