#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int j = 0; j < t; j++) {
    int a, b;
    cin >> a >> b;
    if (a > 2 * b || b > 2 * a) {
      cout << "NO" << endl;
      continue;
    }
    if (a == 2 * b || b == 2 * a) {
      cout << "YES" << endl;
      continue;
    } else {
      int x = max(a, b);
      x = x + x - a + x - b;
      if (x % 3 == 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
