#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; ++i) {
      int x, y;
      cin >> x >> y;
      if (x > y) {
        int z = x - y;
        x -= 2 * z;
        y -= z;
      } else if (x < y) {
        int z = y - x;
        x -= z;
        y -= 2 * z;
      }
      if (!(x % 3) && x >= 0 && y >= 0) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
  return 0;
}
