#include <bits/stdc++.h>
const int INF = 1e18L + 5;
using namespace std;
long long int M = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void input() {}
long long int bs(vector<long long int> &arr, long long int target,
                 long long int end) {
  long long int start = 0;
  long long int ans = -1;
  while (start <= end) {
    long long int mid = (start - end) / 2 + end;
    if (arr[mid] <= target)
      start = mid + 1;
    else {
      ans = mid;
      end = mid - 1;
    }
  }
  return ans;
}
void solve() {
  long long int x, y;
  cin >> x >> y;
  if (x > y) {
    swap(x, y);
  }
  if ((x + y) % 3 == 0 && x * 2 >= y) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  input();
  int t = 1, i = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
}
