You are given two integers $a$ and $b$. You may perform any number of operations on them (possibly zero).

During each operation you should choose any positive integer $x$ and set $a := a - x$, $b := b - 2x$ or $a := a - 2x$, $b := b - x$. Note that you may choose different values of $x$ in different operations.

Is it possible to make $a$ and $b$ equal to $0$ simultaneously?

Your program should answer $t$ independent test cases.


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 100$) — the number of test cases.

Then the test cases follow, each test case is represented by one line containing two integers $a$ and $b$ for this test case ($0 \le a, b \le 10^9$).


-----Output-----

For each test case print the answer to it — YES if it is possible to make $a$ and $b$ equal to $0$ simultaneously, and NO otherwise.

You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES will all be recognized as positive answer).


-----Example-----
Input
3
6 9
1 1
1 2

Output
YES
NO
YES



-----Note-----

In the first test case of the example two operations can be used to make both $a$ and $b$ equal to zero:  choose $x = 4$ and set $a := a - x$, $b := b - 2x$. Then $a = 6 - 4 = 2$, $b = 9 - 8 = 1$;  choose $x = 1$ and set $a := a - 2x$, $b := b - x$. Then $a = 2 - 2 = 0$, $b = 1 - 1 = 0$.

Difficulty: interview

Starter code:

Solutions:

t=int(input())
for nt in range(t):
    a,b=[int(k) for k in input().strip().split(" ")]
    if (a+b)%3 or 2*a<b or 2*b<a:
        print("NO")
    else:
        print("YES")


t = int(input())

for _ in range(t):
    a, b = list(map(int, input().split()))
    if (a + b) % 3 == 0 and 2 * a >= b and 2 * b >= a:
        print("YES")
    else:
        print("NO")


"""This code was written by
Russell Emerine - linguist,
mathematician, coder,
musician, and metalhead."""

n = int(input())
for _ in range(n):
  a, b = list(map(int, input().split()))
  if (a + b) % 3 != 0: print("NO")
  elif 2 * b - a < 0: print("NO")
  elif 2 * a - b < 0: print("NO")
  else: print("YES")


cases=int(input())
for case in range(cases):
    a,b=list(map(int,input().split()))
    if a>b:
        a,b=b,a
    if b>a*2:
        print("NO")
    elif (a+b)%3==0:
        print("YES")
    else:
        print("NO")



from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()

for _ in range(N):
    a,b = inpl()
    a,b = min(a,b), max(a,b)
    a = b = a - (b-a)

    if a%3 == 0 and a >= 0:
        print("YES")
    else:
        print("NO")


n = int(input())
for i in range(n):
    a, b = tuple(map(int, input().split()))
    a, b = min(a, b), max(a, b)
    if (a + b) % 3 == 0 and a >= b - a:
        print("YES")
    else:
        print("NO")


import sys
input = sys.stdin.readline

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]

for a, b in AB:
    L = [a, b]
    m = min(L)
    l = max(L)
    if (a+b)%3 == 0 and l <= m*2:
        print("YES")
    else:
        print("NO")

n = int(input())
for i in range(n):
    a, b = map(int, input().split())
    if a > b:
        tmp = a
        a = b
        b = tmp
    
    if b > 2 * a:
        print("NO")
    else:
        if (a + b) % 3 == 0:
            print("YES")
        else:
            print("NO")

n = int(input())
for i in range(n):
    a, b = list(map(int, input().split()))
    if (a + b) % 3 == 0 and b >= a - b and a >= b - a:
        print("YES")
    else:
        print("NO")


#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=int(input())
for tt in range(t):
    #n=int(input())
    a,b= map(int, sys.stdin.readline().split(' '))
    x=(2*b-a)
    y=(2*a-b)

    if(x>=0 and y>=0 and (x%3==0) and (y%3==0)):
        print("YES")
    else:
        print("NO")
    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

for i in ' '*int(input()):
    a,b=map(int,input().split())
    if (a+b)%3==0:
        if 2*a>=b and 2*b>=a:
            print('YES')
            continue
    print('NO')

N = int(input())
for _ in range(N):
    a, b = list(map(int, input().split()))
    if (a+b) % 3 == 0 and a <= 2*b and b <= 2*a:
        print("YES")
    else:
        print("NO")




n = int(input())
ans = []
for _ in range(n):
    a, b = map(int, input().split())

    m, d = min(a,b), abs(a-b)
    if ((a+b)%3==0) and (2*b-a>=0) and (2*a-b>=0):
        ans.append("YES")
    else: ans.append("NO")

for x in ans:
    print(x)

t = int(input())
for _ in range(t):
    a,b = map(int,input().split())
    if (a+b)%3 == 0 and 2*a-b >= 0 and 2*b-a >= 0:
        print("YES")
    else:
        print("NO")

import sys
input = sys.stdin.readline

t=int(input())

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

    if a>2*b or b>2*a:
        print("NO")

    else:
        if (a+b)%3==0:
            print("YES")
        else:
            print("NO")


n = int(input())

for i in range(n):
    a,b = map(int,input().split())
    if a > b:
        a,b = b,a
    xx = 2 * b - a
    if xx < 0 or xx % 3 != 0:
        print('NO')
        continue
    x = xx // 3
    y = b - 2 * x
    if y < 0:
        print('NO')
        continue
    print('YES')

n=int(input())
for i in range(n):
    a,b=[int(x) for x in input().split(' ')]
    if (a+b) % 3 != 0:
        print('NO')
    else:
        if max(a,b)>2*min(a,b):
            print('NO')
        else:
            if (2*min(a,b)-max(a,b)) % 3 == 0:
                print('YES')
            else:
                print('NO')


t = int(input())
for i in range(t):
  #a-x-2y=0
  #b-2x-y=0
  #x=a-2y
  #b-2(a-2y)-y=0
  #b-2a+3y=0
  #y=(2a-b)/3
  a,b=map(int,input().split())
  if (2*a-b)%3==0 and (2*a-b>=0) and (2*b-a>=0):
    print("YES")
  else:
    print("NO")

t=int(input())
for i in range(t):
	a,b=list(map(int,input().split()))
	if a<b:
		a,b=b,a
	p=a-b
	a-=p*2
	b-=p
	if a%3==0 and b>=0:
		print("YES")
	else:
		print("NO")


t = int(input())
for kkk in range(t):
    a, b = map(int, input().split())
    if (a > 2 * b or b > 2 * a):
        print('NO')
    elif a == 0 and b == 0:
        print('YES')
    elif a == 0 or b == 0:
        print('NO')
    elif (a + b) % 3 == 0:
        print('YES')
    else:
        print('NO')

t = int(input())
for i in range(t):
    a, b= [int(x) for x in input().split()]
    if a < b:
        a, b = b, a
    c = a - b
    a -= 2 * c
    b -= c
    if (a >= 0 and a % 3 == 0):
        print("YES")
    else:
        print("NO")


t = int(input())
for i in range(t):
    a,b = list(map(int,input().split()))
    if (a+b)%3 == 0 and 2*a >= b and 2*b >= a:
        print("YES")
    else:
        print("NO")