#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, n;
  cin >> n;
  while (n--) {
    cin >> a >> b;
    if (2 * a - b >= 0 && 2 * b - a >= 0) {
      if ((2 * a - b) % 3 == 0 && (2 * b - a) % 3 == 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
