#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    int mn = min(a, b);
    int mx = max(a, b);
    int max_poss = mn * 2;
    int min_poss = mn / 2 + (mn & 1) * 2;
    if (mx <= max_poss and mx >= min_poss and (((mx - min_poss) % 3) == 0)) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
