#include <bits/stdc++.h>
using namespace std;
long long bpow(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) ans = ans * a % 998244353;
    b = b / 2;
    a = a * a % 998244353;
  }
  return ans % 998244353;
}
void solve() {
  long long a, b;
  cin >> a >> b;
  if (a <= 2 * b && b <= 2 * a && ((a + b) % 3 == 0))
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long TESTS = 1;
  cin >> TESTS;
  while (TESTS--) {
    solve();
  }
  return 0;
}
