#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, x, y;
int main() {
  cin >> t;
  while (t--) {
    cin >> a >> b;
    if (b > 2 * a || a > 2 * b)
      cout << "No\n";
    else if ((2 * a - b) % 3 == 0 && (2 * b - a) % 3 == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
