#include <bits/stdc++.h>
using namespace std;
template <typename Head>
void print(Head&& head) {
  cout << head << '\n';
}
template <typename Head, typename... Tail>
void print(Head&& head, Tail... tail) {
  cout << head << " ";
  print(tail...);
}
void chandan1() {
  int y = 1;
  return;
}
void chandan2() {
  for (long long int i = 0; i < 10; i++) {
    long long int x = 1;
  }
  return (chandan1());
}
void solve() {
  int a, b;
  cin >> a >> b;
  if ((a + b) % 3 != 0) {
    cout << "NO\n";
    return;
  }
  if (max(a, b) > 2 * min(a, b))
    cout << "NO\n";
  else
    cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  chandan2();
  while (t--) {
    solve();
  }
  return 0;
}
