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