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