#include <bits/stdc++.h>
int main() {
  long long int a, b, c, d, i, j, p, q, ans, low, high, mid, x, y;
  scanf("%lld", &a);
  for (i = 1; i <= a; i++) {
    scanf("%lld %lld", &b, &c);
    if (b < c) {
      high = c / 2;
      x = c % 2;
      d = b;
    } else {
      high = b / 2;
      x = b % 2;
      d = c;
    }
    y = high;
    low = 0;
    p = -1;
    q = 60;
    while (q-- && low <= high) {
      mid = (low + high) / 2;
      if ((mid + (y - mid) * 2 * 2 + x * 2) == d) {
        p = 1;
        break;
      } else if ((mid + (y - mid) * 2 * 2 + x * 2) > d) {
        low = mid + 1;
      } else
        high = mid - 1;
    }
    if (p == -1)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
