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.*;
import java.util.*;
public class Main {
    static PrintWriter pw;
    static HashMap<Character, HashSet<Character>> adj;
    static StringBuilder sb;
    static boolean[] visit;
    static void dfs(char c) {
        visit[(int)c-(int)'a']=true;
        sb.append(c);
        for(char x: adj.get(c)){
            if(!visit[(int)x-((int)'a')])
                dfs(x);
        }
    }
    public static long gcf(long x, long y) {
        while(x%y!=0 && y%x!=0) {
            if(x>y)
                x%=y;
            else
                y%=x;
        }
        return x>y? y:x;
    }
    static int ceildiv(int x, int y){
        return x%y==0? x/y: x/y+1;
    }
    static int prime(int x, int k) {
        int y = (int) Math.sqrt(x);
        int ans = 0;
        for (int i = 1; i <= y && i <= k; i++) {
            if (x % i == 0) {
                if (x / i <= k)
                    return i;
                else
                    ans = i;
            }
        }
        return x / ans;
    }
    static long factorial(long x) {
        long ans=1;
        while(x>1)
            ans*=x--;
        return ans;
    }
    static ArrayList<Character>[] arr;
    static long combination(int a, int b){
        long ans=1l;
        int c=Math.max(a, b-a);
        int temp=b;
        while(temp>c)
            ans*=temp--;
        return ans/factorial(Math.min(a, b-a));
    }
    public static void main(String[] args) throws Exception {
        Scanner sc= new Scanner(System.in);
        pw = new PrintWriter(System.out);
        int t=sc.nextInt();
        while(t-->0){
            int a=sc.nextInt(), b=sc.nextInt();
            int min=Math.min(a,b), max=Math.max(a,b);
            int diff=max-min;
            min-=diff; max-=diff*2;
            pw.println(min<0 || min%3!=0?"NO":"YES");
        }
        pw.close();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        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 {
            return Double.parseDouble(next());
        }

        public int[] nextArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < arr.length; i++)
                arr[i] = nextInt();
            return arr;
        }
        public Integer[] nextsort(int n) throws IOException{
            Integer[] arr=new Integer[n];
            for(int i=0; i<n; i++)
                arr[i]=nextInt();
            return arr;
        }
        public boolean ready() throws IOException {
            return br.ready();
        }
    }
    static class Pair implements Comparable<Pair>{
        int x;
        int y;
        public Pair(int x, int y) {
            this.x=x;
            this.y=y;
        }
        public int hashCode() {
            return this.x*1000+this.y;
        }
        public int compareTo(Pair other) {
            if(this.y!=other.y){
                return other.y-this.y;
            }else{
                return (this.x-other.x);
            }
        }
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (this.getClass() != obj.getClass()) {
                return false;
            }
            Pair p = (Pair) obj;
            return this.x == p.x;
        }
        public boolean equal(Pair p){
            return this.x==p.x && this.y==p.y;
        }
    }
    static class tuple implements Comparable<tuple>{
        int x;int y;int z;
        public tuple(int x, int y, int z){
            this.x=x;
            this.y=y;
            this.z=z;
        }
        public int compareTo(tuple other) {
            if(this.x!=other.x)
                return this.x-other.x;
            else {
                if(this.y!=other.y)
                    return this.y-other.y;
                else
                    return this.z-other.z;
            }
        }
        public boolean equal(tuple t){
            return this.x==t.x && this.y==t.y;
        }
    }
}