#include <bits/stdc++.h>
using namespace std;
bool solve() {
  int a, b;
  cin >> a >> b;
  if (a == 0 && b == 0) return true;
  if ((a + b) % 3 != 0) return false;
  int t = (a + b) / 3 + a - b;
  if (t % 2 != 0) return false;
  int k2 = t / 2;
  int k1 = a - 2 * k2;
  if (k1 >= 0 && k2 >= 0) return true;
  return false;
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    if (solve())
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
