#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0;
  cin >> t;
  while (t--) {
    int a = 0, b = 0, c = 0, d = 0;
    cin >> a >> b >> c >> d;
    if (b > a) swap(a, b);
    if (c < d) swap(c, d);
    if ((a * a) - (a * b) == c * d && c == a) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
