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 ≤ t ≤ 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 ≤ a, b ≤ 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:

  1. choose x = 4 and set a := a - x, b := b - 2x. Then a = 6 - 4 = 2, b = 9 - 8 = 1; 
  2. choose x = 1 and set a := a - 2x, b := b - x. Then a = 2 - 2 = 0, b = 1 - 1 = 0. 
from collections import Counter as C,defaultdict as D,deque as Q
from operator import itemgetter as I
from itertools import product as P,permutations as PERMUT
from bisect import bisect_left as BL,bisect_right as BR,insort as INSORT
from heapq import heappush as HPUSH,heappop as HPOP
from math import floor as MF,ceil as MC, gcd as MG,factorial as F,sqrt as SQRT, inf as INFINITY,log as LOG
from sys import stdin, stdout
INPUT=stdin.readline
PRINT=stdout.write
L=list;M=map

def Player1():
	print("")

def Player2():
	print("")

def Yes():
	PRINT("Yes\n")

def No():
	PRINT("No\n")

def IsPrime(n):

	for i in range(2,MC(SQRT(n))+1):
		if n%i==0:
			return False
	return True

def Factors(x):

	ans=[]

	for i in range(1,MC(SQRT(x))+1):
		if x%i==0:
			ans.append(i)
			if x%(x//i)==0:
				ans.append(x//i)
	return ans
def CheckPath(source,destination,g):
	visited=[0]*101
	q=Q()
	q.append(source)
	visited[source]=1
	while q:
		node=q.popleft()
		if node==destination:
			return 1
		for v in g[node]:
			if not visited[v]:
				q.append(v)
				visited[v]=1
	return 0
def Sieve(n):
	prime=[1]*(n+1)
	p=2
	while p*p<=n:
		if prime[p]:
			for i in range(p*p,n+1,p):
				prime[i]=0
		p+=1
	primes=[]
	for p in range(2,n+1):
		if prime[p]:
			primes.append(p)
	return primes

def Prefix(a,n):
	p=[]
	for i in range(n):
		if i==0:
			p.append(a[0])
		else:
			p.append(p[-1]+a[i])
	return p
def Suffix(a,n):
	s=[0]*n
	for i in range(n-1,-1,-1):
		if i==n-1:
			s[i]=a[i]
		else:
			s[i]=s[i+1]+a[i]
	return s
def Spf(n):
	spf=[0 for i in range(n)]
	spf[1]=1
	for i in range(2,n):
		spf[i]=i
	for i in range(4,n,2):
		spf[i]=2
	for i in range(3,MC(SQRT(n))+1):
		if spf[i]==i:
			for j in range(i*i,n,i):
				if spf[j]==j:
					spf[j]=i
	return spf

def DFS(g,s,visited,ans):
	visited[s]=1
	
	for u,c in g[s]:

		if visited[u]:
			continue

		if c==ans[s]:

			if c==1:
				ans[u]=2
			else:
				ans[u]=1
		else:
			ans[u]=c
		DFS(g,u,visited,ans)


def lcm(a,b):

	return (a*b)//(MG(a,b))
def Kadane(numbers):

	max_so_far=-INFINITY
	max_ending_here=0
	max_element=-INFINITY
	for i in range(len(numbers)):
		max_ending_here=max(max_ending_here+numbers[i],0)
		max_so_far=max(max_ending_here,max_so_far)
		max_element=max(max_element,numbers[i])
	if max_so_far==0:
		max_so_far=max_element
	return max_so_far

def Main():

	for _ in range(int(INPUT())):
		a,b=M(int,INPUT().split( ))
		a,b=min(a,b),max(a,b)
		if (a+b)%3==0 and 2*a>=b:	
			Yes()
		else:
			No()







Main()

'mysql -u root -p'