#include <bits/stdc++.h>
const int MAXN = 200000;
using namespace std;
inline int read() {
  int x = 0, w = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x * w;
}
inline void write(int x) {
  static char sta[10];
  static int top;
  if (x < 0) putchar('-'), x = -x;
  while (sta[++top] = x % 10 ^ 48, x /= 10) continue;
  while (top) putchar(sta[top--]);
  putchar('\n');
}
int gcd(int x, int y) {
  if (!y) return x;
  return gcd(y, x % y);
}
int a, b;
void init() { a = read(), b = read(); }
int main() {
  int t = read();
  while (t--) {
    init();
    if (a == 0 || b == 0) {
      if (a + b != 0) {
        puts("NO");
      } else {
        puts("YES");
      }
      continue;
    }
    if ((a + b) % 3 == 0 && min(a, b) * 2 >= max(a, b)) {
      puts("YES");
    } else {
      puts("NO");
    }
  }
  return 0;
}
