Alice has a lovely piece of cloth. It has the shape of a square with a side of length $a$ centimeters. Bob also wants such piece of cloth. He would prefer a square with a side of length $b$ centimeters (where $b < a$). Alice wanted to make Bob happy, so she cut the needed square out of the corner of her piece and gave it to Bob. Now she is left with an ugly L shaped cloth (see pictures below).

Alice would like to know whether the area of her cloth expressed in square centimeters is prime. Could you help her to determine it?


-----Input-----

The first line contains a number $t$ ($1 \leq t \leq 5$) — the number of test cases.

Each of the next $t$ lines describes the $i$-th test case. It contains two integers $a$ and $b~(1 \leq b < a \leq 10^{11})$ — the side length of Alice's square and the side length of the square that Bob wants.


-----Output-----

Print $t$ lines, where the $i$-th line is the answer to the $i$-th test case. Print "YES" (without quotes) if the area of the remaining piece of cloth is prime, otherwise print "NO".

You can print each letter in an arbitrary case (upper or lower).


-----Example-----
Input
4
6 5
16 13
61690850361 24777622630
34 33

Output
YES
NO
NO
YES



-----Note-----

The figure below depicts the first test case. The blue part corresponds to the piece which belongs to Bob, and the red part is the piece that Alice keeps for herself. The area of the red part is $6^2 - 5^2 = 36 - 25 = 11$, which is prime, so the answer is "YES". [Image] 

In the second case, the area is $16^2 - 13^2 = 87$, which is divisible by $3$. [Image] 

In the third case, the area of the remaining piece is $61690850361^2 - 24777622630^2 = 3191830435068605713421$. This number is not prime because $3191830435068605713421 = 36913227731 \cdot 86468472991 $.

In the last case, the area is $34^2 - 33^2 = 67$.

Difficulty: interview

Starter code:

Solutions:
def isPrime(n) : 
    # Corner cases 
    if (n <= 1) : 
        return False
    if (n <= 3) : 
        return True
  
    # This is checked so that we can skip  
    # middle five numbers in below loop 
    if (n % 2 == 0 or n % 3 == 0) : 
        return False
  
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
  
    return True
t=int(input())
for yes in range(t):
	a,b=map(int,input().split())
	xx=a-b
	yy=a+b 
	if xx==1 and isPrime(yy)==True:
		print("YES")
	else:
		print("NO")

read = lambda: map(int, input().split())
def prime(x):
    d = 2
    while d*d<= x:
        if x % d == 0: return 0
        d += 1
    return 1
t = int(input())
res = ""
for i in range(t):
    a, b = read()
    res += "YES\n" if a-b==1 and prime(a+b) else "NO\n"
print(res)

def isPrime(n):
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            return False
    return True

    return True
for i in ' '*int(input()):
    a,b=map(int,input().split())
    if a-b>1:print('NO')
    else:
        print(['NO','YES'][isPrime(a+b)])

def check_prime(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1
    return True

t = int(input())
for tnum in range(t):
    a, b = map(int, input().split())
    if a != b + 1:
        print("NO")
    else:
        print("YES" if check_prime(a + b) else "NO")

from math import sqrt
n = int(input())
for i in range(n):
    a, b = map(int, input().split())
    first = a - b
    second = a + b
    if first != 1:
        print('NO')
    else:
        f = False
        for i in range(2, int(sqrt(second)) + 1):
            if second % i == 0:
                f = True
                break
        if f:
            print('NO')
        else:
            print('YES')

def prime(n):
    if n < 2:
        return False
    elif n % 2 == 0:
        return False
    else:
        for k in range(3, 1 + int(n ** .5), 2):
            if n % k == 0:
                return False
    return True


t = int(input())
for i in range(t):
    a, b = list(map(int, input().split()))
    n = (a + b)
    if a - b > 1:
        print('NO')
    else:
        if prime(n):
            print('YES')
        else:
            print('NO')


t = int(input())
for _ in range(t):
    a, b = list(map(int, input().split()))
    if a - b != 1:
        print("NO")
        continue
    c = a + b
    for t in range(2, int(c ** 0.5) + 1):
        if c % t == 0:
            print("NO")
            break
    else:
        print("YES")


def check(a):
    for i in range(2, round(a**0.5 + 1)):
        if not a % i:
            return 0
    return 1


for i in range(int(input())):
    a, b = map(int, input().split())
    if (a - b) > 1 and (a + b) > 1:
        print('NO')
    else:
        print('YES' if check(a**2-b**2) else 'NO')

from math import sqrt 
from itertools import count, islice

def isPrime(n):
    return n > 1 and all(n%i for i in islice(count(2), int(sqrt(n)-1)))

t=int(input())

for i in range(t):
	a,b=map(int,input().split())
	ans = False
	if a-b==1:
		x = a+b
		ans=isPrime(x)

	if ans:
		print("YES")
	else:
		print("NO")

t=int(input())
import math
for i in range(t):
    a,b=list(map(int,input().split()))
    if((a-b)!=1):
        print("NO")
    else:
        l=2*a-1
        p=0
        for k in range(2,int(math.sqrt(l))+1):
            if(l%k==0):
                print("NO")
                p=1
                break 
        if(p==0):
            print("YES")


def prime(x):
    if x==1:
        return False
    ret=True
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            ret=False
    return ret

n=int(input())
for i in range(n):
    s=input().split()
    d=int(s[0])-int(s[1])
    if d!=1:
        print("NO")
    else:
        if prime(int(s[0])+int(s[1])):
            print("YES")
        else:
            print("NO")


t = int(input())
while t > 0:
    a, b = list(map(int,input().split()))
    if a - b != 1 :
        print("NO")
    else:
        num = a + b
        num2 = int(num ** 0.5)
        num3 = 2
        ans = 0
        while num3 <= num2:
            if num % num3 == 0:
                ans = 1
            num3 += 1
        if ans == 1:
            print("NO")
        else:
            print("YES")
    t -= 1


import sys

def isprime(x):
    import math
    if x == 1:
        return True

    for i in range(2, math.ceil(math.sqrt(x))+1):
        if x % i == 0:
            return False
    return True


def __starting_point():
    cin = sys.stdin

    T = int(next(cin))
    for _ in range(T):
        n, m = list(map(int, next(cin).split()))

        # n**2-m**2 = (n-m)*(n+m)

        if n-m == 1 and isprime(n+m):
            print('YES')
        else:
            print('NO')

__starting_point()

def isPrime(n) : 
    # Corner cases 
    if (n <= 1) : 
        return False
    if (n <= 3) : 
        return True
  
    # This is checked so that we can skip  
    # middle five numbers in below loop 
    if (n % 2 == 0 or n % 3 == 0) : 
        return False
  
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
  
    return True
t=int(input())
for l in range(t):
	a,b=list(map(int,input().split()))
	if(a-b!=1):
		print("NO")
	else:
		if(isPrime(a+b)):
			print('YES')
		else:
			print('NO')



from math import sqrt; from itertools import count, islice

n = int(input())


def isPrime(n):
    return n > 1 and all(n%i for i in islice(count(2), int(sqrt(n)-1)))

def eval_(a, b):
    if  abs(a - b)!=1:
        return "NO"
    result = isPrime(a + b)
    if result:
        return "YES"
    else:
        return "NO"


for i in range(n):
    (a, b) = [int(x) for x in input().split()]
    print(eval_(a, b))

import math

t = int(input())


def isprime(c):
	# print(int(math.ceil(math.sqrt(c)))+1)
	for x in range(2, int(math.ceil(math.sqrt(c)))+1):
		# print("x: {}".format(x))
		if c % x == 0:
			return False

	return True

for x in range(t):
	a, b = list(map(int, input().split()))
	if (1 == a-b) and isprime(a + b):
		print ("YES")
	else:
		print ("NO")





from math import sqrt, floor


def check(n):
    for i in range(2, floor(sqrt(n)) + 1):
        if (n % i == 0):
            return False

    return True


t = int(input())

for i in range(t):
    a, b = list(map(int, input().split()))

    if (a - b == 1 and check(a + b)):
        print("YES")
    else:
        print("NO")


t = int(input())

def divider(n):
    i = 2
    j = 0
    while i**2 <= n and j != 1:
        if n%i == 0:
            j = 1
        i += 1
    if j == 1:
        return False
    else:
        return True


for i in range(t):
    a, b = list(map(int,input().split()))
    if a-b == 1 and divider(a+b):
        print("YES")
    else:
        print("NO")


def isprime(n):
    i = 2
    m = n
    while (i * i <= n):
        while (n % i == 0):
            n /= i
        i += 1
    return m == n


t = int(input())
for i in range(t):
    a, b = map(int, input().split())
    if (isprime(a + b) and a - b == 1):
        print("YES")
    else:
        print("NO")

t=int(input())
a=[]
b=[]
for i in range(t):
    aa,bb=[int(el) for el in input().split()]
    a.append(aa)
    b.append(bb)

def prost(n):
    if n==3:
        return True
    if n%2==0:
        return False
    for i in range (3,int(n**0.5)+1,2):
        if n%i==0:
            return False
    return True
    return

for i in range(t):
    if a[i]-b[i]!=1:
        print ('NO')
        continue
    if prost(a[i]+b[i]):
        print('YES')
    else:
        print('NO')


import random
def MillerRabinPrimalityTest(number):
    '''
    because the algorithm input is ODD number than if we get
    even and it is the number 2 we return TRUE ( spcial case )
    if we get the number 1 we return false and any other even 
    number we will return false.
    '''
    if number == 2:
        return True
    elif number == 1 or number % 2 == 0:
        return False
    
    ''' first we want to express n as : 2^s * r ( were r is odd ) '''
    
    ''' the odd part of the number '''
    oddPartOfNumber = number - 1
    
    ''' The number of time that the number is divided by two '''
    timesTwoDividNumber = 0
    
    ''' while r is even divid by 2 to find the odd part '''
    while oddPartOfNumber % 2 == 0:
        oddPartOfNumber = oddPartOfNumber // 2
        timesTwoDividNumber = timesTwoDividNumber + 1 
     
    '''
    since there are number that are cases of "strong liar" we 
    need to check more then one number
    '''
    for time in range(3):
        
        ''' choose "Good" random number '''
        while True:
            ''' Draw a RANDOM number in range of number ( Z_number )  '''
            randomNumber = random.randint(2, number)-1
            if randomNumber != 0 and randomNumber != 1:
                break
        
        ''' randomNumberWithPower = randomNumber^oddPartOfNumber mod number '''
        randomNumberWithPower = pow(randomNumber, oddPartOfNumber, number)
        
        ''' if random number is not 1 and not -1 ( in mod n ) '''
        if (randomNumberWithPower != 1) and (randomNumberWithPower != number - 1):
            # number of iteration
            iterationNumber = 1
            
            ''' while we can squre the number and the squered number is not -1 mod number'''
            while (iterationNumber <= timesTwoDividNumber - 1) and (randomNumberWithPower != number - 1):
                ''' squre the number '''
                randomNumberWithPower = pow(randomNumberWithPower, 2, number)
                
                # inc the number of iteration
                iterationNumber = iterationNumber + 1
            '''     
            if x != -1 mod number then it because we did not found strong witnesses
            hence 1 have more then two roots in mod n ==>
            n is composite ==> return false for primality
            '''
            if (randomNumberWithPower != (number - 1)):
                return False
            
    ''' well the number pass the tests ==> it is probably prime ==> return true for primality '''
    return True
cases=int(input())
for case in range(cases):
    a,b=map(int,input().split())
    t=MillerRabinPrimalityTest((a**2)-(b**2))
    if t:
        print("YES")
    else:
        print("NO")

def divider(n):
    i = 2
    j = 0
    while i**2 <= n and j != 1:
        if n % i == 0:
            j = 1
        i += 1
    if j == 1:
        return False
    else:
        return True


i = int(input())
for i in range(i):
    a, b = list(map(int, input().split()))
    if a - b == 1 and divider(a+b):
        print("YES")
    else:
        print("NO")


import math

def is_prime(n):
    bound = int(math.sqrt(n + 1) + 1)
    for k in range(2, bound):
        if n % k == 0:
            return False
    return True


def solve():
    a, b = (int(x) for x in input().split())
    if a - b != 1:
        print('NO')
        return

    if is_prime(a+b):
        print('YES')
    else:
        print('NO')


num_tests = int(input())
for _ in range(num_tests):
    solve()



import math as m
def f(a):
	if (a==2) : return True
	for i in range(2,round(m.sqrt(a))+1):
		if a%i==0:
			return False
	return True

t=int(input())


for i in range(t):
	a,b=input().split()

	a=int(a)
	b=int(b)

	if (a-b)==1 and f(a+b) :
		print("YES")
	else :
		print("NO")