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.io.*;
import java.text.DecimalFormat;
public class Exam {
	public static long mod = (long)Math.pow(10, 9)+7 ;
	public static double epsilon=0.00000000008854;//value of epsilon
	public static InputReader sc = new InputReader(System.in);
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void d(int n,int s,int a[],String ans){
		if(a[0]==1){
			return;
		}
		if(n<=0){
			if(Math.sqrt(s)-(int)Math.sqrt(s)==0)
			{
				a[0]=1;
				pw.println(ans);
			}
			return;
		}
		for(int i=1;i<10;i++){
			d(n-1,s+i*i,a,ans+i);
		}
	}
	public static int gr(int s,int e,int a[][],int k,int dp[][]){
		int t=0;
		if(dp[s][k]!=0)
		return dp[s][k];
		if(s==e&&k==0){
			dp[s][k]=1;
			return 1;
		}
		if(k<=0){
			dp[s][k]=0;
			return 0;
		}
		for(int i=0;i<a[s].length;i++){
			if(a[s][i]==1){
				t+=gr(i,e,a,k-1,dp);
			}
		}
		dp[s][k]=t;
		return t;
	}
	public static int f(int n,int k,int v[],int dp[][]){
		
		if(n==0)
		return 0;
		if(n<0||k<=0)
		return -1;
		if(dp[n][k]!=0){
			return dp[n][k];
		}
		int c=f(n-k,k,v,dp);
		if(c==-1){
			dp[n][k]=f(n, k-1, v, dp);
		}
		else{
			dp[n][k]=Math.max(c+v[k-1],f(n, k-1, v, dp));
		}
		return dp[n][k];
	}
	public static int f1(int n,int v[],int dp[]){
		if(n==0)
		return v[0];
		else if(n==1)
		return Math.max(v[0],v[1]);

		if(dp[n]!=0)
		return dp[n];
		else{
			dp[n]=Math.max(f1(n-2,v,dp)+v[n], f1(n-1,v,dp));
			return dp[n];
		}

	}
	public static double dis(int x,int y,int x1[],int y1[],int x2[],int y2[],int x3[],int y3[]){
		double d1[]=new double [x1.length];
		double d2[]=new double [x2.length];
		Arrays.fill(d2,Long.MAX_VALUE);
		for(int i=0;i<x1.length;i++){
			d1[i]=Math.sqrt(Math.pow(x1[i]-x, 2)+Math.pow(y1[i]-y, 2));
		}
		for(int i=0;i<x2.length;i++){
			for(int j=0;j<x3.length;j++){
				d2[i]=Math.min(Math.sqrt(Math.pow(x2[i]-x3[j], 2)+Math.pow(y2[i]-y3[j], 2)), d2[i]);
			}
		}
		double min=Long.MAX_VALUE;
		for(int i=0;i<x1.length;i++){
			for(int j=0;j<x2.length;j++){
				min=Math.min(d1[i]+d2[j]+Math.sqrt(Math.pow(x1[i]-x2[j], 2)+Math.pow(y1[i]-y2[j], 2)), min);
			}
		}
		return min;
	}
	public static int check(int b,int c,int a[][],int f[]){
		int d=0,in=-1;
		for(int i=0;i<a.length;i++){
			if(i!=f[0]){
				if(b==a[i][0]||b==a[i][1]||b==a[i][2]){
					if(c==a[i][0]||c==a[i][1]||c==a[i][2]){
						in=i;
						f[0]=in;
						break;
					}
				}
			}
		}
		if(in!=-1){
			for(int i=0;i<3;i++){
				if(a[in][i]!=b&&a[in][i]!=c)
				d=a[in][i];
			}
		}
		return d;
	}
	public static long dp(int n,int k,int m,long dp[][],long a[]){
		if(k==0&&n>=-1)
		return 0;
		if(n-m==-1&&k==1){
			dp[n][k]=a[n];
		}
		else if(n-m<0){
			dp[n][k]=0;
		}
		else if(dp[n][k]!=-1)
		return dp[n][k];
		else{
			dp[n][k]=Math.max((long)a[n]+dp(n-m,k-1,m,dp,a), dp(n-1,k,m,dp,a));
		}
		return dp[n][k];
	}
	public static void main(String[] args) {
		// code starts..
		int q=sc.nextInt();
		while(q-->0){
			StringBuilder out=new StringBuilder();
			int n=sc.nextInt();
			int m=sc.nextInt();
			double y=(double)(2*n-m)/3.0;
			double x=(double)(2*m-n)/3.0;
			if(x-Math.floor(x)==0&&x>=0&&y-Math.floor(y)==0&&y>=0){
				pw.println("YES");
			}
			else{
				pw.println("NO");
			}
		}
		// Code ends...
		pw.flush();
		pw.close();
	}
	static class tripletL implements Comparable<tripletL> {
		Long x, y, z;

		tripletL(long x, long y, long z) {
			this.x = x;
			this.y = y;
			this.z = z;
		}

		public int compareTo(tripletL o) {
			int result = x.compareTo(o.x);
			if (result == 0)
				result = y.compareTo(o.y);
			if (result == 0)
				result = z.compareTo(o.z);

			return result;
		}

		public boolean equlas(Object o) {
			if (o instanceof tripletL) {
				tripletL p = (tripletL) o;
				return (x - p.x == 0) && (y - p.y ==0 ) && (z - p.z == 0);
			}
			return false;
		}

		public String toString() {
			return x + " " + y + " " + z;
		}

		public int hashCode() {
			return new Long(x).hashCode() * 31 + new Long(y).hashCode() + new Long(z).hashCode();
		}
	}
	public static String Doubleformate(double a){
		DecimalFormat f =new DecimalFormat("#.00");
		return f.format(a);
	}
 
	public static Comparator<Integer[]> column(int i){
		return 
		new Comparator<Integer[]>() {
			@Override
			public int compare(Integer[] o1, Integer[] o2) {
					Integer quantityOne = o1[i];
				Integer quantityTwo = o2[i];
				return quantityOne.compareTo(quantityTwo);
			}
		};
	}
	public static Comparator<Integer[]> pair(){
		return 
		new Comparator<Integer[]>() {
			@Override
			public int compare(Integer[] o1, Integer[] o2) {
				int result=o1[0].compareTo(o2[0]);
				if(result==0)
				result=o1[1].compareTo(o2[1]);
				return result;
			}
		};
	}
	public static Comparator<Integer[]> Triplet(){
		return 
		new Comparator<Integer[]>() {
			@Override
			public int compare(Integer[] o1, Integer[] o2) {
			
					for(int i=0;i<3;i++){
						for(int j=i+1;j<3;j++){
							for(int k=0;k<3;k++){
								for(int p=k+1;p<3;p++){
									if((o1[i]==o2[k]&&o1[j]==o2[p])||(o1[j]==o2[k]&&o1[i]==o2[p])){

									}
								}
							}
						}
					}
					int result=o1[0].compareTo(o2[0]);
					if(result==0)
					result=o1[1].compareTo(o2[1]);
					if(result==0)
					result=o1[2].compareTo(o2[2]);
					return result;
			}
		};
	}
	
	
	public static String reverseString(String s){
		StringBuilder input1 = new StringBuilder(); 
        input1.append(s);  
		input1 = input1.reverse();
		return input1.toString();
	}
	public static int[] scanArray(int n){
		int a[]=new int [n];
		for(int i=0;i<n;i++)
		a[i]=sc.nextInt();
 
		return a;
	}
	public static long[] scanLongArray(int n){
		long a[]=new long [n];
		for(int i=0;i<n;i++)
		a[i]=sc.nextLong();
 
		return a;
	}
	public static String [] scanStrings(int n){
		String a[]=new String [n];
		for(int i=0;i<n;i++)
		a[i]=sc.nextLine();
 
		return a;
	}
	static class InputReader {
 
		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}
 
		public String readString() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public String nextLine() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isEndOfLine(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
 
}