#include <bits/stdc++.h>
using namespace std;
long long power(long long base, long long pow, long long mo) {
  long long res = 1;
  while (pow) {
    if (pow % 2 != 0) res = (res * base) % mo;
    base = (base * base) % mo;
    pow /= 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, i, j, x;
  cin >> t;
  while (t--) {
    long long c, s;
    cin >> c >> s;
    if (c > 2 * s || s > 2 * c || (s + c) % 3)
      cout << "No\n";
    else
      cout << "yEs\n";
  }
  return 0;
}
