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