Fantasy Pair

For each pair of string lengths A and B, decide whether their sum can be written as a sum of two primes.

Medium4MathNumber theoryBrute forceImplementationNo attempts yetTime limit1sMemory limit256 MB

Problem

In Didiland, the land of fantasy, every resident carries one string as a token of fate. Whether two residents are a fantasy pair is decided in a very plain way. Join their two strings into one, and if that string can be cut exactly into two strings whose lengths are both prime, the two residents are a fantasy pair. Deciding whether such a cut exists is hard for them, so most of them walk past each other without ever knowing.

Write a program that decides whether two residents are a fantasy pair.

Assume that joining the strings and cutting them lose no length at all.

Input

The first line contains the number of test cases TT (1T5001 \le T \le 500).

Each of the next TT lines contains the lengths AA and BB of the two strings, separated by a space. (1A,B2×10121 \le A, B \le 2 \times 10^{12})

Output

Print one line per test case. Print YES if the joined string can be cut exactly into two strings of prime length, and NO otherwise.