#include <bits/stdc++.h>
using namespace std;
inline void Solve() {
  int a, b;
  cin >> a >> b;
  if (a > b) swap(a, b);
  if (2 * a >= b && (a + b) % 3 == 0)
    puts("YES");
  else
    puts("NO");
}
signed main() {
  int q;
  for (cin >> q; q--;) Solve();
  return 0;
}
