#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, m, i, j;
  cin >> t;
  while (t--) {
    cin >> m >> n;
    if (m > n) swap(m, n);
    if (m * 2 >= n and (n + m) % 3 == 0) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
