#include <bits/stdc++.h>
using namespace std;
vector<long long> ft(1, 1LL);
void solve() {
  long long a, b;
  cin >> a >> b;
  if (a > b) swap(a, b);
  if (2 * a - b >= 0 and (2 * a - b) % 3 == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
signed main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
