#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar();
  return x * f;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  register int t = read();
  while (t--) {
    long long a = read(), b = read();
    if ((a + b) % 3 != 0) {
      cout << "No" << endl;
      continue;
    }
    long long xy = (a + b) / 3;
    long long y = a - xy;
    long long x = xy - y;
    if (x >= 0 && y >= 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
