#P8845. [传智杯 #4 初赛] 小卡和质数

[传智杯 #4 初赛] 小卡和质数

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 11 that has no divisors other than 11 and itself.

Problem Description

Xiaoka has T(1T105)T(1\le T\le 10^5) queries. In each query, you are given two positive integers x,y(1x,y109)x,y(1\le x,y\le 10^9).

Xiaoka wants to know whether the xx-th prime number and the yy-th prime number satisfy pxpy=1p_x \oplus p_y = 1, that is, whether the XOR value of the xx-th prime and the yy-th prime is 11.

Input Format

The first line contains a positive integer TT, representing the number of queries.

The next TT lines each contain two positive integers x,yx,y, representing a query about the xx-th prime number and the yy-th prime number.

Output Format

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

4
1 2
23 145
66 2
1 14
Yes
No
No
No

Hint

Translated by ChatGPT 5