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.lang.reflect.Array;
import java.util.StringTokenizer;
import java.util.function.Function;

public class P1260B {

    static boolean multipleIndependent = true;

    void run() {
        long a = in.nextInt();
        long b = in.nextInt();
        long d = (a + b) / 3;
        if ((a + b) % 3 == 0 && a - d >= 0 && b - d >= 0) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

    /* -----: Template :----- */
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public static void main(String[] args) {
        int q = multipleIndependent ? in.nextInt() : 1;
        while (q-- > 0) {
            new P1260B().run();
        }
        out.flush();
    }

    static class InputReader {

        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            int bufferSize = 32 * 1024;
            reader = new BufferedReader(new InputStreamReader(stream), bufferSize);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public <T> T[] nextIntArrayWithFunction(int n, Function<Integer, T> function, Class<T> c) {
            T[] arr = (T[]) Array.newInstance(c, n);
            for (int i = 0; i < n; i++) {
                arr[i] = function.apply(nextInt());
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public <T> T[] nextLongArrayWithFunction(int n, Function<Long, T> function, Class<T> c) {
            T[] arr = (T[]) Array.newInstance(c, n);
            for (int i = 0; i < n; i++) {
                arr[i] = function.apply(nextLong());
            }
            return arr;
        }

        public int[][] nextIntMap(int n, int m) {
            int[][] map = new int[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = nextIntArray(m);
            }
            return map;
        }

        public long[][] nextLongMap(int n, int m) {
            long[][] map = new long[n][m];
            for (int i = 0; i < n; i++) {
                map[i] = nextLongArray(m);
            }
            return map;
        }

        public char[][] nextCharMap(int n) {
            char[][] map = new char[n][];
            for (int i = 0; i < n; i++) {
                map[i] = next().toCharArray();
            }
            return map;
        }
    }

//    static int numLength(long n) {
//        int l = 0;
//        while (n > 0) {
//            n /= 10;
//            l++;
//        }
//        return l;
//    }
//
//    static <R> long binarySearch(long lowerBound, long upperBound,
//            R value, Function<Long, R> generatorFunction, Comparator<R> comparator) {
//        if (lowerBound <= upperBound) {
//            long mid = (lowerBound + upperBound) / 2;
//            int compare = comparator.compare(generatorFunction.apply(mid), value);
//            if (compare == 0) {
//                return mid;
//            } else if (compare < 0) {
//                return binarySearch(mid + 1, upperBound, value, generatorFunction, comparator);
//            } else {
//                return binarySearch(lowerBound, mid - 1, value, generatorFunction, comparator);
//            }
//        } else {
//            return -1;
//        }
//    }
//
//    static <T> Integer[] sortSimultaneously(T[] key, Comparator<T> comparator,
//            Object[]... moreArrays) {
//        int n = key.length;
//        for (Object[] array : moreArrays) {
//            if (array.length != n) {
//                throw new RuntimeException("Arrays must have equals lengths");
//            }
//        }
//        Integer[] indices = new Integer[n];
//        for (int i = 0; i < n; i++) {
//            indices[i] = i;
//        }
//        Comparator<Integer> delegatingComparator = (a, b) -> {
//            return comparator.compare(key[a], key[b]);
//        };
//        Arrays.sort(indices, delegatingComparator);
//        reorder(indices, key);
//        for (Object[] array : moreArrays) {
//            reorder(indices, array);
//        }
//        return indices;
//    }
//
//    static void reorder(Integer[] indices, Object[] arr) {
//        if (indices.length != arr.length) {
//            throw new RuntimeException("Arrays must have equals lengths");
//        }
//        int n = arr.length;
//        Object[] copy = new Object[n];
//        for (int i = 0; i < n; i++) {
//            copy[i] = arr[indices[i]];
//        }
//        System.arraycopy(copy, 0, arr, 0, n);
//    }
//    static int prodMod(int a, int b, int mod) {
//        return (int) (((long) a) * b % mod);
//    }
//
//    static long prodMod(long a, long b, long mod) {
//        long res = 0;
//        a %= mod;
//        b %= mod;
//        while (b > 0) {
//            if ((b & 1) > 0) {
//                res = (res + a) % mod;
//            }
//            a = (a << 1) % mod;
//            b >>= 1;
//        }
//        return res;
//    }
//
//    static long sumMod(int[] b, long mod) {
//        long res = 0;
//        for (int i = 0; i < b.length; i++) {
//            res = (res + b[i] % mod) % mod;
//        }
//        return res;
//    }
//
//    static long sumMod(long[] a, long mod) {
//        long res = 0;
//        for (int i = 0; i < a.length; i++) {
//            res = (res + a[i] % mod) % mod;
//        }
//        return res;
//    }
//
//    static long sumProdMod(int[] a, long b, long mod) {
//        long res = sumMod(a, mod);
//        return prodMod(res, b, mod);
//    }
//
//    static long sumProdMod(long[] a, long b, long mod) {
//        long res = sumMod(a, mod);
//        return prodMod(res, b, mod);
//    }
//
//    static long sumProdMod(int[] a, int[] b, long mod) {
//        if (a.length != b.length) {
//            throw new RuntimeException("Arrays must have equals lengths");
//        }
//        long res = 0;
//        for (int i = 0; i < a.length; i++) {
//            res = (res + prodMod(a[i], b[i], mod)) % mod;
//        }
//        return res;
//    }
//
//    static long sumProdMod(long[] a, long[] b, long mod) {
//        if (a.length != b.length) {
//            throw new RuntimeException("Arrays must have equals lengths");
//        }
//        long res = 0;
//        for (int i = 0; i < a.length; i++) {
//            res = (res + prodMod(a[i], b[i], mod)) % mod;
//        }
//        return res;
//    }
//
//    static int[] toPrimitive(Integer[] arr) {
//        int[] res = new int[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static int[][] toPrimitive(Integer[][] arr) {
//        int[][] res = new int[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toPrimitive(arr[i]);
//        }
//        return res;
//    }
//
//    static long[] toPrimitive(Long[] arr) {
//        long[] res = new long[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static long[][] toPrimitive(Long[][] arr) {
//        long[][] res = new long[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toPrimitive(arr[i]);
//        }
//        return res;
//    }
//
//    static Integer[] toWrapper(int[] arr) {
//        Integer[] res = new Integer[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static Integer[][] toWrapper(int[][] arr) {
//        Integer[][] res = new Integer[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toWrapper(arr[i]);
//        }
//        return res;
//    }
//
//    static Long[] toWrapper(long[] arr) {
//        Long[] res = new Long[arr.length];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = arr[i];
//        }
//        return res;
//    }
//
//    static Long[][] toWrapper(long[][] arr) {
//        Long[][] res = new Long[arr.length][];
//        for (int i = 0; i < arr.length; i++) {
//            res[i] = toWrapper(arr[i]);
//        }
//        return res;
//    }
}
