#include <bits/stdc++.h>
using namespace std;
long long int in[200000 + 1];
map<long long int, long long int> mp;
long long int power(long long int x, unsigned long long int y,
                    long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int tc;
  cin >> tc;
  while (tc--) {
    long long int r, b, k, g;
    cin >> r >> b;
    if (r > b) swap(r, b);
    if (b > 2 * r) {
      cout << "NO"
           << "\n";
    } else if (b == 2 * r) {
      cout << "YES"
           << "\n";
    } else {
      if ((r + b) % 3 == 0) {
        cout << "YES"
             << "\n";
      } else {
        cout << "NO"
             << "\n";
      }
    }
  }
  return 0;
}
