#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;
void print() { cout << endl; }
void printarray() { return; }
void scan() { return; }
template <typename T, typename... Args>
void print(T a, Args... arg) {
  cout << a << " ";
  print(arg...);
}
template <typename T, typename... Args>
void scan(T &a, Args &...arg) {
  cin >> a;
  scan(arg...);
}
template <typename T, typename... Args>
void scan(vector<T> &v, Args &...arg) {
  for (auto &i : v) cin >> i;
  scan(arg...);
}
template <typename T, typename... Args>
void printarray(vector<T> &v, Args &...arg) {
  for (auto i : v) cout << i << " ";
  cout << endl;
  printarray(arg...);
}
const long long int mxN = 1e6 + 5;
vector<long long int> prime(mxN);
void sieve() {
  for (long long int i = 0; i < mxN; i++) {
    prime[i] = true;
  }
  prime[0] = false;
  prime[1] = false;
  for (long long int p = 2; p * p < mxN; p++) {
    if (prime[p]) {
      for (long long int i = p * p; i < mxN; i += p) {
        prime[i] = false;
      }
    }
  }
}
long long int isprime(long long int x) {
  if (x <= 1) return 0;
  for (long long int i = 2; i <= x / 2; i++) {
    if (x % i == 0) {
      return 0;
    }
  }
  return 1;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
void stryker27() {
  long long int a, b;
  cin >> a >> b;
  if (a > b) swap(a, b);
  if (b <= 2 * a && (a + b) % 3 == 0)
    print("YES");
  else
    print("NO");
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) stryker27();
  return 0;
}
