#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  int res[t];
  for (int i = 0; i < t; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    int min = a, dx = b - a;
    if (b < a) min = b;
    if (dx < 0) dx = -dx;
    res[i] = 0;
    if (a == 0 && b == 0) res[i] = 1;
    if (a > 0 && b > 0 && (a + b) % 3 == 0 && min >= dx - 1) res[i] = 1;
  }
  for (int i = 0; i < t; i++) {
    printf((res[i] == 1) ? "YES\n" : "NO\n");
  }
  return 0;
}
