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. 
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;
public class Solution
{
    static class Pair{
        int parent;
        int rank;
        Pair(int parent,int rank)
        {
            this.rank=rank;
            this.parent=parent;
        }
    }
    static int find(Pair pr[],int i)
    {
        if(i==pr[i].parent)
            return i;
        else
        {
            pr[i].parent=find(pr,pr[i].parent);
            return pr[i].parent;
        }
    }
    static void join(Pair[] pr,int i,int j)
    {
        i=find(pr,i);
        j=find(pr,j);
        if(i==j)
            return;
        if(pr[i].rank>=pr[j].rank)
        {
            pr[j].parent=i;
            pr[i].rank+=pr[j].rank;
        }
        else
        {
            pr[i].parent = j;
            pr[j].rank+=pr[i].rank;
        }
    }
    static void swap(char ar[],int i,int j)
    {
        char f = ar[i];
        ar[i]=ar[j];
        ar[j]=f;
    }
    static TreeSet<Integer> hs;
    static ArrayList<Integer> graph[] ;
    static int dp[][];
	public static void main (String[] args) throws IOException
	{
            StringBuilder sb = new StringBuilder();
            FastReader s1 = new FastReader();
            int t =s1.I();
            while(t--!=0)
            {
               long a = s1.L();
               long b = s1.L();
               long min = Math.min(a,b);
               long max=Math.max(a, b);
               if(2l*min==max)
               {
                   sb.append("YES\n");
               }
               else
               {
                   long temp1 = max-1;
                   boolean ans=true;
                   long temp2=min-2;
                   if((2*min-max)%3==0)
                   {
                       long x1 = (2*min-max)/3;
                       long x2 = min-2*x1;
                       if(x1>=0 && x2>=0)
                       {
                           sb.append("YES\n");
                           continue;
                       }
                       else
                       {
                           sb.append("NO\n");
                           ans=false;
                           continue;
                       }
                   }
                   else
                   {
                        temp1 = max-2;
                        temp2=min-1;
                        if((2*min-max)%3==0)
                        {
                            long x1 = (2*min-max)/3;
                       long x2 = min-2*x1;
                       if(x1>=0 && x2>=0)
                       {
                           sb.append("YES\n");
                           continue;
                       }
                       else
                       {
                           sb.append("NO\n");
                           ans=false;
                           continue;
                       }
                        }
                        else
                        {
                            sb.append("NO\n");
                            continue;
                        }
                   }
               }
            }
            System.out.println(sb);
        }
        static void dfs(int index,boolean ar[])
        {
            ar[index]=true;
            for(int i=0;i<graph[index].size();i++)
            {
                if(!ar[graph[index].get(i)])
                {
                    dfs(graph[index].get(i),ar);
                }
            }
        }
        static int binary(int left,int right,int ar[],int no)
        {
             int mid=(left+right)/2;
             if(Math.abs(right-left)<=1)
             {
                 if(no>=ar[right])
                 {
                     return right+1;
                 }
                 else if(no<ar[left])
                 {
                     return left;
                 }
                 else
                 {
                      return left+1;
                 }
             }
             if(ar[mid]>no)
             {
                 right=mid-1;
                 return binary(left, right, ar, no);
             }
             else{
                 left=mid;
                 return binary(left, right, ar, no);
                         }
        }
	static class FastReader{
        BufferedReader br; 
        StringTokenizer st; 
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int I() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long L() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double D() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
    static int gcd(int a,int b)
		{
		    if(a%b==0)
		    return b;
		    return gcd(b,a%b);
		}
	static float power(float x, int y) 
    { 
        float temp; 
        if( y == 0) 
            return 1; 
        temp = power(x, y/2);  
          
        if (y%2 == 0) 
            return temp*temp; 
        else
        { 
            if(y > 0) 
                return x * temp * temp; 
            else
                return (temp * temp) / x; 
        } 
    } 
      static long pow(long x, long y) 
    { 
        int p = 1000000007;
        long res = 1;      
        x = x % p;  
        while (y > 0) 
        { 
            if((y & 1)==1) 
                res = (res * x) % p;
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    } 
    static ArrayList<Integer> sieveOfEratosthenes(int n) 
    { 
        ArrayList<Integer> arr=new ArrayList<Integer>();
        boolean prime[] = new boolean[n+1]; 
        for(int i=2;i<n;i++) 
            prime[i] = true; 
          
        for(int p = 2; p*p <=n; p++) 
        { 
            if(prime[p] == true) 
            { 
                arr.add(p);
                for(int i = p*p; i <= n; i += p) 
                    prime[i] = false; 
            } 
        } 
        return arr;
    } 
}
