Chef has 2 numbers A and B (A < B).

Chef will perform some operations on A. 

In the i^{th} operation:
Chef will add 1 to A if i is odd.
Chef will add 2 to A if i is even.

Chef can stop at any instant. Can Chef make A equal to B?

------ Input Format ------ 

- The first line contains a single integer T — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two space separated integers A and B.

------ Output Format ------ 

For each test case, output YES if Chef can make A and B equal, NO otherwise.

Note that the checker is case-insensitive. So, YES, Yes, yEs are all considered same.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ A < B ≤ 10^{9}$

----- Sample Input 1 ------ 
4
1 2
3 6
4 9
10 20

----- Sample Output 1 ------ 
YES
YES
NO
YES

----- explanation 1 ------ 
Test case 1: Chef may perform one operation to make $A$ equal to $B$: $1 \xrightarrow{+1} 2$

Test case 2: $3 \xrightarrow{+1} 4 \xrightarrow{+2} 6$

Test case 3: It can be shown that it is impossible to make $A$ and $B$ equal.

Test case 4: $10 \xrightarrow{+1} 11 \xrightarrow{+2} 13 \xrightarrow{+1} 14 \xrightarrow{+2} 16 \xrightarrow{+1} 17 \xrightarrow{+2} 19 \xrightarrow{+1} 20$

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
n = int(input())
for i in range(0, n):
	(num1, num2) = map(int, input().split())
	num3 = num2 - num1 - 2
	if num3 % 3 == 0:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	s = abs(a - b)
	if s % 3 != 2:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	s = abs(x - y)
	if s % 3 != 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	if (b - a) % 3 == 2:
		print('NO')
	else:
		print('YES')


for j in range(int(input())):
	(x, y) = map(int, input('').split())
	if (y - x) % 3 == 2:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c = b - a
	if (c - 2) % 3 == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(z, w) = map(int, input().split())
	c = w - z
	if c % 3 == 2:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	(x, y) = map(int, input().split())
	c = y - x
	if c % 3 == 2:
		print('NO')
	else:
		print('YES')


T = int(input())
for _ in range(T):
	(A, B) = map(int, input().split())
	print('NO') if (B - A - 2) % 3 == 0 else print('YES')


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if (b - a) % 3 == 1 or (b - a) % 3 == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b) = map(int, input().split())
	c = b - a
	if c % 3 <= 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(A, B) = map(int, input().split())
	diff = B - A
	if diff % 3 == 0 or diff % 3 == 1:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(A, B) = [int(a) for a in input().split()]
	if (B - A + 1) % 3 == 0:
		print('NO')
	else:
		print('YES')


try:
	t = int(input())
	for r in range(t):
		(a, b) = map(int, input().split())
		x = b - a
		if x == 1 or x == 0:
			print('YES')
		elif x % 3 == 0 or x % 3 == 1:
			print('YES')
		else:
			print('NO')
except:
	pass


for i in range(int(input())):
	(a, b) = map(float, input().split())
	x = b - a
	if x % 3 == 0 or x % 3 == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(x, y) = map(int, input().split())
	z = y - x
	if (z - 2) % 3 == 0:
		print('NO')
	else:
		print('YES')


for i in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	val = abs(a - b)
	if val % 3 == 0 or val % 3 == 1:
		print('YES')
	else:
		print('NO')