#include <bits/stdc++.h>
using namespace std;
double eps = 1e-6;
int read() {
    int s = 0;
    int f = 1;
    char ch = getchar();
    while ((ch < '0' || ch > '9') && ch != EOF) {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        s = s * 10 + ch - '0';
        ch = getchar();
    }
    return s * f;
}
void solve() {
    vector<int> a(4);
    for (int i = 0; i < 4; ++i) a[i] = read();
    do {
        if (abs(a[1] * log(a[0])  - a[3] * log(a[2])) < eps) {
            puts("YES");
            return;
        }
    } while (next_permutation(a.begin(), a.end()));
    puts("NO");
}
int main() {
    int t = read();
    while (t--) solve();
    return 0;
}
// 64 位输出请用 printf("%lld")