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.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class data_structure {
	public static class edge implements Comparable<edge> {
		int x;
		int y;
		long h;

		@Override
		public String toString() {
			return "edge [x=" + x + ", y=" + y + ", h=" + h + "]";
		}

		public edge(int x, int y, long h) {
			super();
			this.x = x;
			this.y = y;
			this.h = h;
		}

		@Override
		public int compareTo(edge o) {
			if(y==o.y)
				return o.x-x;
			return o.y - y;
		}

	}

	static class fenwickTree {
		int n;
		long[] tree;

		public fenwickTree(int n) {
			this.n = n;
			tree = new long[n + 1];
		}

		public fenwickTree(int n, long[] arr) {
			this.n = n;
			tree = arr.clone();
			for (int i = 1; i <= n; i++) {
				int j = i + (i & -i);
				if (j <= n)
					tree[j] += tree[i];
			}
		}

		public void updatePointbuValue(int idx, int value) {
			int gett = (int) getSumupRange(idx, idx);
			updatePointadd(idx, value - gett);
		}

		public void updatePointadd(int idx, long value) {
			while (idx <= n) {
				tree[idx] = Math.max(value, tree[idx]);
				idx += (idx & -idx);
			}
		}

		public long getSumupTo(int u) {
			long sum = 0;
			while (u > 0) {
				sum = Math.max(sum, tree[u]);
				u = u - (u & -u);
			}
			return sum;
		}

		public long getSumupRange(int l, int r) {
			return getSumupTo(r) - getSumupTo(l - 1);
		}
	}

	public static void main(String[] args) throws Exception {
		PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		Scanner sc = new Scanner(System.in);
		int t=sc.nextInt();
		while(t-->0){
			int g=sc.nextInt();
					int k=sc.nextInt();
			int a=Math.max(g, k);
			int b=Math.min(g, k);
			
			int left=0;
			int right=a/2;
			boolean ans=false;
			while(left<=right){
				
				int mid=(left+right)/2;
				int x=a-2*mid;
				int y=b-mid;
				if(y-2*x==0)
				{
					ans=true;
					break;
				}
				else if(y-2*x<0)
					left=mid+1;
				else
					right=mid-1;
			}
			pw.println((ans)?"YES":"NO");
		}
		pw.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}
