#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <string>
#include <utility>

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>

#include <stdio.h>
#include <cstring>

#include <stdlib.h>
#include <time.h>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int UI;
typedef unsigned char UC;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<UI> VUI;

#define DEBUG 1
#define F(i,n) for(int i=0;i<n;i++)
#define FOR(i,s,n) for(int i=s;i<n;i++)
#define FORE(i,s,n) for(int i=s;i<=n;i++)
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? (-1*(a)) : (a))
#define INSET(s, e) ((s).find(e) != (s).end())
#define INMAP(s, e) ((s).find(e) != (s).end())
#define TRACE(v) (cout << "TRACE(" << #v << "): " << v << endl)
#define TRACE1D(v,s) { cout << "TRACE1D(" << #v << ", " << (s) << "): "; F(i,s) cout << (v)[i] << " "; cout << endl; }
#define TRACE2D(v,s1,s2) { cout << "TRACE2D(" << #v << ", " << (s1) << ", " << (s2) << "): "; F(i,s1) { cout << endl << "\t"; F(j,s2) cout << v[i][j] << " "; } cout << endl; }
#define TRACE2DS(v) { cout << "TRACE2DS(" << #v << "): "; F(i,v.size()) { cout << endl << "\t"; F(j,v[i].size()) cout << v[i][j] << " "; } cout << endl; }
#define FOREACH(it, s) for (auto it = s.begin(); it != s.end(); it++)

#define MAXNM 100005

bool possible(UI n, UI m, UI k, UI A[MAXNM], UI  B[MAXNM]) {
    sort(A, A + n);
    sort(B, B + m);
    int bAhead = 0, i = n - 1, j = m - 1;
    while ((i >= 0 || j >= 0) && bAhead >= 0) {
        if (j < 0 || i >= 0 && A[i] > B[j]) {
            do {
                i--;
                bAhead--;
            } while (i >= 0 && A[i + 1] == A[i]);
        } else if (j >= 0 && i >= 0 && A[i] == B[j]) {
            int ac = 0, bc = 0;
            do {
                i--;
                ac++;
            } while (i >= 0 && A[i + 1] == A[i]);
            do {
                j--;
                bc++;
            } while (j >= 0 && B[j + 1] == B[j]);
            bAhead += (bc - ac);
        } else {
            do {
                j--;
                bAhead++;
            } while (j >= 0 && B[j + 1] == B[j]);
        }
        //TRACE(bAhead);
    }

    return (bAhead < 0);
}

void solve() {
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);

    UI n, m, k, A[MAXNM], B[MAXNM];
    while (cin >> n >> m >> k) {
        F(i,n) {
            cin >> A[i];
        }
        F(i,m) {
            cin >> B[i];
        }
        cout << (possible(n, m, k, A, B) ? "YES" : "NO") << endl;
    }

}

void assert(bool b, const char *msg = NULL) {
    static int test = 0;
    test++;

    if (!b) {
        if (msg == NULL) {
            cout << "Error :: " << test << endl;
        } else {
            cout << "Error :: " << test << " :: " << msg << endl;
        }
    }
}

void tests() {

}

int main() {
    //srand(time(NULL));
    tests();
    solve();
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>

using namespace std;

int main() {
    int N, M, K; cin >> N >> M >> K;

    map<int, int> A, B;
    set<int> S;
    for (int i = 0; i < N; ++i) {
        int x; cin >> x;
        A[x]++;
        S.insert(x);
    }

    for (int i = 0; i < M; ++i) {
        int x; cin >> x;
        B[x]++;
        S.insert(x);
    }

    int alice = 0, bob = 0;
    for (auto it = S.rbegin(); it != S.rend(); ++it) {
        alice += A[*it];
        bob += B[*it];

        if (alice > bob) {
            cout << "YES\n";
            return 0;
        }
    }

    cout << "NO\n";
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <memory.h>
#include <ctime>
#include <unordered_map>

using namespace std;

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

unordered_map<int,int> mm1,mm2;
vector<int> a;
int main()
{
#ifdef Fcdkbear
    freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    double beg=clock();
#endif

	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	FOR(i,0,n)
	{
		int v;
		scanf("%d",&v);
		mm1[v]++;
		a.push_back(v);
	}
	FOR(i,0,m)
	{
		int v;
		scanf("%d",&v);
		mm2[v]++;
		a.push_back(v);
	}
	sort(a.begin(),a.end());
	a.resize(unique(a.begin(),a.end())-a.begin());
	int dif=0;
	for (int i=(int)a.size()-1; i>=0; --i)
	{
		dif+=mm1[i]-mm2[i];
		if (dif>0)
		{
			cout<<"YES"<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
#ifdef Fcdkbear
    double end=clock();
    fprintf(stderr,"*** Total time = %.3lf ***\n",(end-beg)/CLOCKS_PER_SEC);
#endif
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <memory.h>
#include <ctime>
#include <unordered_map>

using namespace std;

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

unordered_map<int,int> mm1,mm2;
vector<int> a;
int main()
{
#ifdef Fcdkbear
    freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    double beg=clock();
#endif

	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	FOR(i,0,n)
	{
		int v;
		scanf("%d",&v);
		mm1[v]++;
		a.push_back(v);
	}
	FOR(i,0,m)
	{
		int v;
		scanf("%d",&v);
		mm2[v]++;
		a.push_back(v);
	}
	sort(a.begin(),a.end());
	a.resize(unique(a.begin(),a.end())-a.begin());
	int dif=0;
	for (int i=(int)a.size()-1; i>=0; --i)
	{
		dif+=mm1[a[i]]-mm2[a[i]];
		if (dif>0)
		{
			cout<<"YES"<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
#ifdef Fcdkbear
    double end=clock();
    fprintf(stderr,"*** Total time = %.3lf ***\n",(end-beg)/CLOCKS_PER_SEC);
#endif
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#define fast ios_base::sync_with_stdio (false),
 cin.tie(NULL),cout.tie(NULL)
int main()
{
 fast;
 int t;
 cin>>t;
 while(t--)
 {
   int a, b, c, d, l1, l2, m1, m2;
   cin>>a>>b>>c>>d;
   l1=min(a,b);
   l2=min(c,d);
   m1=max(a,b);
   m2=max(c,d);
   if(l1 + l2 == m1 && m1==m2)
   {
     cout<<"YES\n";
   }
   else
   cout<<"NO\n"
 }


#include<iostream>
#include<bits/stdc++>
#include<algorithm>
#define fast ios_base::sync_with_stdio (false),
 cin.tie(NULL),cout.tie(NULL)
int main()
{
 fast;
 int t;
 cin>>t;
 while(t--)
 {
   int a, b, c, d, l1, l2, m1, m2;
   cin>>a>>b>>c>>d;
   l1=min(a,b);
   l2=min(c,d);
   m1=max(a,b);
   m2=max(c,d);
   if(l1 + l2 == m1 && m1==m2)
   {
     cout<<"YES\n";
   }
   else
   cout<<"NO\n"
 }


#include<iostream>
using namespace std;

int sha(int a1,int b1)
{
if(a1>b1)
return b1;
else
return a1;
}
int mah(int a2,int b2)
{
if(a2>b2)
return b2;
else
return a2;
}
int max(int a1,int b1,int a2,int b2)
{
if(a1>b1&&a1==b2||a1==a2 && b2!=a2)
return a1;
else if(b1>a1&&b1==b2||a2==a2 && b2!=a2)
return b1;
else
return 0;
}
int main()
{
int a1,a2,b1,b2,ans1,ans2,ans3,i,ans4,t;
cin>>t;
for(i=0;i<t;i++)
{
cin>>a1>>b1;
cin>>a2>>b2;
ans1=sha(a1,b1);
ans2=mah(a2,b2);
ans4=max(a1,b1,a2,b2);
ans3=ans1+ans2;
if(ans3==ans4)
cout<<"Yes\n";
else
cout<<"No\n";
}
 }


// Problem link :
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <deque>
#include <bitset>
#include <climits>
#include <cstdio>
#include <list>
#include <iomanip>
using namespace std;

#define ll long long int
#define mp make_pair
#define pb push_back
#define fi first
#define si second
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define AS 200001
#define mod 1000000007
int main()
{
fastIO
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--)
{
	ll a1,b1,a2,b2;
	cin>>a1>>b1>>a2>>b2;
	ll val = a1*b1 + a2*b2;
	double sr = sqrt(val);
	if(a1==b1 or a2==b2)
	{
		cout<<"NO"<<endl;

	}
	else
	{
	cout<<(!(sr-floor(sr))?"YES":"NO");
	cout<<endl;
}
}
return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    int test;
    cin >> test;

    while (test--){
        vector <int> recta(2), rectb(2);
        cin >> recta[0] >> recta[1] >> rectb[0] >> rectb[1];

        sort(recta.begin(), recta.end());
        sort(rectb.begin(), rectb.end());

        if (recta[0]+rectb[0]==recta[1] && recta[1]==rectb[1]){
            cout << "YES" << endl;
        }
        else cout << "NO" << endl;
    }
}


// Problem link :
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <deque>
#include <bitset>
#include <climits>
#include <cstdio>
#include <list>
#include <iomanip>
using namespace std;

#define ll long long int
#define mp make_pair
#define pb push_back
#define fi first
#define si second
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define AS 200001
#define mod 1000000007
int main()
{
fastIO
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--)
{
	ll a1,b1,a2,b2;
	cin>>a1>>b1>>a2>>b2;
	ll val = a1*b1 + a2*b2;
	double sr = sqrt(val);
	if(a1==b1 or a2==b2)
	{
		cout<<"NO"<<endl;

	}
	else
	cout<<(!(sr-floor(sr))?"YES":"NO");
cout<<endl;
}
return 0;
}


// Problem link :
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <deque>
#include <bitset>
#include <climits>
#include <cstdio>
#include <list>
#include <iomanip>
using namespace std;

#define ll long long int
#define mp make_pair
#define pb push_back
#define fi first
#define si second
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define AS 200001
#define mod 1000000007
int main()
{
fastIO
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--)
{
	ll a1,b1;
	cin>>a1>>b1;
	ll a2,b2;
	cin>>a2>>b2;
	ll val = a1*b1 + a2*b2;
	double sr = sqrt(val);
	if(a1==b1 or a2==b2)
	{
		cout<<"NO"<<endl;
		break;
	}
	else
	cout<<(!(sr-floor(sr))?"YES":"NO");
cout<<endl;
}
return 0;
}


// Problem link :
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <deque>
#include <bitset>
#include <climits>
#include <cstdio>
#include <list>
#include <iomanip>
using namespace std;

#define ll long long int
#define mp make_pair
#define pb push_back
#define fi first
#define si second
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define AS 200001
#define mod 1000000007
int main()
{
fastIO
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--)
{
	ll a1,b1,a2,b2;
	cin>>a1>>b1>>a2>>b2;
	ll val = a1*b1 + a2*b2;
	double sr = sqrt(val);
	if(a1==b1 or a2==b2)
	{
		cout<<"NO"<<endl;
		break;
	}
	else
	cout<<(!(sr-floor(sr))?"YES":"NO");
cout<<endl;
}
return 0;
}


// Problem link :
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <deque>
#include <bitset>
#include <climits>
#include <cstdio>
#include <list>
#include <iomanip>
using namespace std;

#define ll long long int
#define mp make_pair
#define pb push_back
#define fi first
#define si second
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define AS 200001
#define mod 1000000007
int main()
{
fastIO
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--)
{
	ll a1,b1;
	cin>>a1>>b1;
	ll a2,b2;
	cin>>a2>>b2;
	ll val = a1*b1 + a2*b2;
	double sr = sqrt(val);
	cout<<(!(sr-floor(sr))?"YES":"NO");
cout<<endl;
}
return 0;
}


// Problem link :
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <deque>
#include <bitset>
#include <climits>
#include <cstdio>
#include <list>
#include <iomanip>
using namespace std;

#define ll long long int
#define mp make_pair
#define pb push_back
#define fi first
#define si second
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define F1(a,n) for(int i=1;i<=n;i++){cin>>a[i];}
#define P(a,n) for(int i=0;i<n;i++){cout<<a[i]<<' ';}cout<<endl;
#define P1(a,n) for(int i=1;i<=n;i++){cout<<a[i]<<' ';}cout<<endl;
#define NF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>>a[i][j];}}
#define NF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cin>>a[i][j];}}
#define PNF(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define PNF1(a,n,m) for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){cout<<a[i][j]<<' ';}cout<<endl;}cout<<endl;
#define AS 200001
#define mod 1000000007
int main()
{
fastIO
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--)
{
	ll a1,b1,a2,b2;
	cin>>a1>>b1>>a2>>b2;
	ll val = a1*b1 + a2*b2;
	double sr = sqrt(val);
	if(a1==b1 or a2==b2)
	{
		cout<<"NO"<<endl;

	}
	else
	{
	ll val = 2*(a1+b1) + 2*(a2+b2);
	// cout<<sr-floor(sr)<<" "<<!(val%4)<<endl;
	if(!(sr-floor(sr)) and !(val%4))
		cout<<"YES";
	else
		cout<<"NO";
	cout<<endl;
}
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if((x*x == Area) && ((x1 != y1) && (x2 != y2)) )
            {
                if(x1 == x2 && x1 != y2 && y1 != y2)
                {
                    if(y1 + y2 == x1)
                        cout << "Yes\n";
                    else cout <<"No\n";
                }

                             else if(x1 == y2 && x1 != x2 && y1 != y2 && y1 !=x2)
                {
                    if(y1 + x2 == x1)
                        cout << "Yes\n";
                    else cout <<"No\n";
                }

                               else if(y1 == x2 && x2 != x1 && y1 != y2 && x1 != y2)
                {
                    if(x1 + y2 == y1)
                        cout << "Yes\n";
                    else cout <<"No\n";
                }

                               else if(y1 == y2 && y1 != x2 && x1 != x2)
                {
                    if(x1 + x2 == y1)
                        cout << "Yes\n";
                    else cout <<"No\n";
                }
                else if(x1 == x2 && y1 == y2)
                {
                    if(x1 > y1)
                    {
                        if(y1 + y2 == x1)
                            cout << "Yes\n";
                        else cout << "No\n";
                    }
                    else if(y1 > x1)
                    {
                        if(x1 + x2 == y1)
                            cout << "Yes\n";
                        else cout << "No\n";
                    }
                }
                else if(x1 == y2 && y1 ==x2)
                {
                    if(x1 + y1 == x2 + y2)
                        cout << "Yes\n";

                    else cout << "No\n";
                }

            }
            else cout << "No\n";

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;

            int x;
            x = sqrt(Area);
            if(x*x == Area)
            {
                cout << "Yes\n";
            }
            else
            {
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if((x*x == Area) && ((x1 != y1) && (x2 != y2)) )
            {
                if(x1+x2 == y1+y2 || x1+y2 == x2+y1 || x1+x2 == y1 && y1 == y2 || x1+y2 == y1 && y1 == x2 || y1+y2 == x1 && x1 == x2)
                    cout << "Yes\n";
                else cout << "No\n";
            }
            else cout << "No\n";

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if((x*x == Area) && ((x1 != y1) && (x2 != y2)) )
            {
                if(x1 == x2 && x1 != y2 && y1 != y2)
                {
                    if(y1 + y2 == x1)
                        cout << "Yes";
                    else cout <<"No";
                }

                             else if(x1 == y2 && x1 != x2 && y1 != y2 && y1 !=x2)
                {
                    if(y1 + x2 == x1)
                        cout << "Yes";
                    else cout <<"No";
                }

                               else if(y1 == x2 && x2 != x1 && y1 != y2 && x1 != y2)
                {
                    if(x1 + y2 == y1)
                        cout << "Yes";
                    else cout <<"No";
                }

                               else if(y1 == y2 && y1 != x2 && x1 != x2)
                {
                    if(x1 + x2 == y1)
                        cout << "Yes";
                    else cout <<"No";
                }
                else if(x1 == x2 && y1 == y2)
                {
                    if(x1 > y1)
                    {
                        if(y1 + y2 == x1)
                            cout << "Yes";
                        else cout << "No";
                    }
                    else if(y1 > x1)
                    {
                        if(x1 + x2 == y1)
                            cout << "Yes";
                        else cout << "No";
                    }
                }
                else if(x1 == y2 && y1 ==x2)
                {
                    if(x1 + y1 == x2 + y2)
                        cout << "Yes";

                    else cout << "No";
                }

            }
            else cout << "No\n";

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;

            int x;
            x = sqrt(Area);
            if(x*x == Area && ((x1 == x2 || x2 == y2) || (y1 == x2 || y1 == y2)))
            {
                cout << "Yes\n";
            }
            else
            {
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if((x*x == Area) && ((x1 != y1) && (x2 != y2)) )  // first e check korlam area purno borgo kina then dekhlam rectangular shape gular
                                                            // length and width oshoman kina,shoman hoile to ar rectangular thaklo na.
            {
                if(x1 == x2)
                {
                    if((y1+y2 == x1)  || (x1+x2 == y1+y2))
                        cout << "yes\n";
                    else
                        cout << "No\n";

                }
                else if(x1 == y2)
                {
                    if(y1 + x2 == x1  || (x1+x2 == y1+y2))
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

                               else if(y1 == x2)
                {
                    if(y2 + x1 == y1  || (x1+x2 == y1+y2))
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

                               else if(y1 == y2)
                {
                    if(x1 + x2 == y1 || (x1+x2 == y1+y2))
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

            }
            else{
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;

            int x;
            x = sqrt(Area);
            if(x*x == Area && ((x1 == x2 || x1 == y2) || (y1 == x2 || y1 == y2)))
            {
                cout << "Yes\n";
            }
            else
            {
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if((x*x == Area) && ((x1 != y1) && (x2 != y2)) )  // first e check korlam area purno borgo kina then dekhlam rectangular shape gular
                                                            // length and width oshoman kina,shoman hoile to ar rectangular thaklo na.
            {
                if(x1 == x2)
                {
                    if((y1+y2 == x1)  || (x1+x2 == y1+y2) || (x1+y2 == y1+x2))
                        cout << "yes\n";
                    else
                        cout << "No\n";

                }
                else if(x1 == y2)
                {
                    if(y1 + x2 == x1  || (x1+x2 == y1+y2) || (x1+y2 == y1+x2))
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

                               else if(y1 == x2)
                {
                    if(y2 + x1 == y1  || (x1+x2 == y1+y2) || (x1+y2 == y1+x2))
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

                               else if(y1 == y2)
                {
                    if(x1 + x2 == y1 || (x1+x2 == y1+y2) || (x1+y2 == y1+x2))
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

            }
            else{
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;

            int x;
            x = sqrt(Area);
            if(x*x == Area)
            {
                cout << "Yes";
            }
            else
            {
                cout << "No";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if((x*x == Area) && ((x1 != y1) && (x2 != y2)) )
            {
                if(x1+x2 == y1+y2 || x1+y2 == x2+y1 || x1+x2 == y1 && y1 == y2 || x1+y2 == y1 && y1 == x2 || y1+y2 == x1 && x1 == x2 || x2+y1 ==x1 && x1 == y2)
                    cout << "Yes\n";
                else cout << "No\n";
            }
            else cout << "No\n";

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if(x*x == Area && ((x1 != y1) && (x2 != y2)) )  // first e check korlam area purno borgo kina then dekhlam rectangular shape gular
                                                            // length and width oshoman kina,shoman hoile to ar rectangular thaklo na.
            {
                if(x1 == x2)
                {
                    if(y1+y2 == x1)
                        cout << "yes\n";
                    else
                        cout << "No\n";

                }
                else if(x1 == y2)
                {
                    if(y1 + x2 == x1)
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

                               else if(y1 == x2)
                {
                    if(y2 + x1 == y1)
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

                               else if(y1 == y2)
                {
                    if(x1 + x2 == y1)
                        cout << "Yes\n";
                    else
                        cout << "No\n";
                }

            }
            else{
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if(x*x == Area && ((x1 != y1) && (x2 != y2)) && x >= x1 && x >= x2 && x >= y1 && x >= y2 )  // first e check korlam area purno borgo kina then dekhlam rectangular shape gular
                                                            // length and width oshoman kina,shoman hoile to ar rectangular thaklo na.
            {

                cout << "Yes\n";
            }
            else
            {
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;       // 2 ta rectangular er area bahir koira jog korlam jate main square tar area pai.

            int x;
            x = sqrt(Area);
            if(x*x == Area && ((x1 != y1) && (x2 != y2)) && (x > x1) && (x >x2) && (x > y1) && (x > y2) )  // first e check korlam area purno borgo kina then dekhlam rectangular shape gular
                                                            // length and width oshoman kina,shoman hoile to ar rectangular thaklo na.
            {

                cout << "Yes\n";
            }
            else
            {
                cout << "No\n";
            }

     }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a1,b1,a2,b2;
    int testCase;
    cin >> testCase;
    while(testCase--)
    {
        cin >> a1 >> b1;
        cin >> a2 >> b2;

        if(b1 > a1)
            swap(a1,b1);
        if(b2 > a2)
            swap(a2,b2);
        if(a1 == a2 && b1+b2 == a1 && a1 != b1 && a2 != b2)
        cout << "Yes\n";
        else cout << "No\n";

    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int testCase;
     cin >> testCase;
     int x1,y1,x2,y2;

     for ( int i = 0; i < testCase; i++)
     {
            cin >> x1 >> y1;
            cin >> x2 >> y2;
            int Area = x1*y1 + x2*y2;

            int x;
            x = sqrt(Area);
            if(x*x == Area && ((x1 != y1) && (x2 != y2)))
            {

                cout << "Yes\n";
            }
            else
            {
                cout << "No\n";
            }

     }

    return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(max(a,b) == max(c,d) && min(a,b) + min(c,d) == max(a,b))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a+b+c+d / 3 = max(a,b))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if((a+b+c+d) / 3 == max(a,b))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(min(a,b)+min(c,d) == max(a,b))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int x = min(a,b) + min(c,d);
    if(x == max(a,b) || x == max(c,d))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    set<int, greater<int> > s;
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    s.insert(a); s.insert(b); s.insert(c); s.insert(d);
    if((a+b+c+d) == *s.begin()*3)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if((a+b+c+d) / 3 == max(a,b,c,d))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if((a+b+c+d) / 3 == max(a,max(b,max(c,d))))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if((a+b+c+d)%3==0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include <iostream>
#include <map>
#include <vector>
#include <iterator>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#define endl '\n'
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  //freopen("input.txt", "r", stdin);
  int t; cin >> t;
  while(t--) {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int d = min(a,b) + min(c,d);
    if(d == max(a,b) || d == max(c,d))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        e=a+b+c+d;
        f=sqrt(e);
        if((f*f)==e)
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        vector<long long>v;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
        v.push_back(d);
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        if((v[0]==v[1]) && ((v[2]+(v[0]-v[2])) == (v[3]+(v[0]-v[3]))) && ((v[2]+v[3])==v[0]))
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        e=a+b+c+d;
        if(e%3!=0)
        {
            cout<<"NO"<<endl;
        }
        else
        {
            f=e/3;
            e+=f;
            if(e%4==0)
                cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        e=max(a,b);
        f=max(c,d);
        if(e==f && ((min(a,b)+min(c,d))==e))
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        vector<long long>v;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
        v.push_back(d);
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        if((v[0]==v[1]) && ((v[2]+v[3])==v[0]))
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        vector<long long>v;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
        v.push_back(d);
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        if((v[0]==v[1]) && ((v[2]+(v[0]-v[2])) == (v[3]+(v[0]-v[3]))))
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        vector<long long>v;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
        v.push_back(d);
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        if((v[0]==v[1]) && ((v[2]+(v[0]-v[2])) == (v[3]+(v[0]-v[3]))
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        e=(a*b)+(c*d);
        f=sqrt(e);
        if((f*f)==e)
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c>>d;
        e=a+b+c+d;
        if(e%3!=0)
        {
            cout<<"NO"<<endl;
        }
        else
        {
            f=e/3;
            e+=f;
            if(e%4==0)
            {
                cout<<"YES"<<endl;
            }
            else cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,x,y,sum,a,b;

   cin>>t;
   while(t--)
   {
     cin>>x>>y;
     cin>>a>>b;
     if(a==b || x==y)
     {
         cout<<"NO"<<endl;
     }
     else
     {
         cout<<"YES"<<endl;
     }
    // cout<<sum<<endl;

   }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,x,y,sum,a,b,c=0,d=0;

   cin>>t;
   while(t--)
   {
     cin>>x>>y;
     cin>>a>>b;
     if(x+y==a && x+y=b)
     {
         cout<<"YES"<<endl;
     }
     else if(a+b==x && a+b==y)
     {
        cout<<"YES"<<endl;
     }
     else if(x+b==a && a+y==b)
     {
         cout<<"YES"<<endl;
     }
     else if(a+y==x && x+b==y)
     {
         cout<<"YES"<<endl;
     }
     else
     {
        cout<<"NO"<<endl;
     }
   }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,x,y,sum,a,b,c=0,d=0;

   cin>>t;
   while(t--)
   {
     cin>>x>>y;
     cin>>a>>b;
     if(x+y==a && x+y==b)
     {
         cout<<"YES"<<endl;
     }
     else if(a+b==x && a+b==y)
     {
        cout<<"YES"<<endl;
     }
     else if(x+b==a && a+y==b)
     {
         cout<<"YES"<<endl;
     }
     else if(a+y==x && x+b==y)
     {
         cout<<"YES"<<endl;
     }
     else
     {
        cout<<"NO"<<endl;
     }
   }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,x,y,sum,a,b,c=0;

   cin>>t;
   while(t--)
   {
     cin>>x>>y;
     cin>>a>>b;
      if(x==y && a==b)
    {
        cout<<"YES"<<endl;
    }
     if(x==a)
     {
         y+=b;
         if(x==y)
         {
            cout<<"YES"<<endl;
         }
         else
         {
             cout<<"NO"<<endl;
         }
     }
    else if(x==b)
     {
         y+=a;
         if(x==y)
         {
             cout<<"YES"<<endl;
         }
          else
         {
             cout<<"NO"<<endl;
         }
     }
    else if(y==a)
     {
         x+=b;
          if(x==y)
         {
             cout<<"YES"<<endl;
         }
          else
         {
             cout<<"NO"<<endl;
         }

     }
    else if(y==b)
     {
         x+=a;
          if(x==y)
         {
             cout<<"YES"<<endl;
         }
          else
         {
             cout<<"NO"<<endl;
         }
      }
    else
    {
        cout<<"NO"<<endl;
    }
     }
   }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,x,y,sum,a,b,c=0;

   cin>>t;
   while(t--)
   {
     cin>>x>>y;
     cin>>a>>b;
     if(x==a)
     {
         c=y;
         y+=b;
         b+=c;
     }
    else if(x==b)
     {
         c=y;
         y+=a;
         a+=c;
     }
    else if(y==a)
     {
         c=x;
         x+=b;
         b+=c;
     }
    else if(y==b)
     {
         c=x;
         x+=a;
         a+=c;
     }
    if(x==y && a==b)
    {
        cout<<"YES"<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }
   }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,x,y,sum,a,b,c=0,d=0;

   cin>>t;
   while(t--)
   {
     cin>>x>>y;
     cin>>a>>b;
     c=x;
     d=a;
     c+=y;
     d+=b;
     if(x==a)
     {
         y+=b;
         if(x==y)
         {
            cout<<"YES"<<endl;
         }
         else
         {
             cout<<"NO"<<endl;
         }
     }
    else if(x==b)
     {
         y+=a;
         if(x==y)
         {
             cout<<"YES"<<endl;
         }
          else
         {
             cout<<"NO"<<endl;
         }
     }
    else if(y==a)
     {
         x+=b;
          if(x==y)
         {
             cout<<"YES"<<endl;
         }
          else
         {
             cout<<"NO"<<endl;
         }

     }
    else if(y==b)
     {
         x+=a;
          if(x==y)
         {
             cout<<"YES"<<endl;
         }
          else
         {
             cout<<"NO"<<endl;
         }
      }
     else if(c==a)
      {
        cout<<"YES"<<endl;
      }
     else
     {
        cout<<"NO"<<endl;
     }
     }
   }


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,x,y,sum,a,b,c=0,d=0;

   cin>>t;
   while(t--)
   {
     cin>>a>>b;
     cin>>x>>y;
        if(a==x && b+y==a)
            cout<<"Yes"<<endl;
        else if(a==y && b+x==a)
            cout<<"Yes"<<endl;
        else if(b==x && a+y==b)
            cout<<"Yes"<<endl;
        else if(b==y && a+x==b)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
    }

}


#include <iostream>
using namespace std;
int main(){
  int a,b,c,d,e,f=0;
  cin >> a;
  int values[a];
  for(int i = 0; i < a; i++){
	  cin >> b >> c;
	  cin >> d >> e;
	  f = b * c * d * e;
	  values[i] = f;
		  }

	  for(int x = 0; x < a; x++){
		  f =  values[x];
		  if(f % 2 == 0){
			  cout << "Yes" << endl;
		  }
		  else{
			  cout << "No" << endl;
		  }
		  }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
#define sqr(int) (int * int)
#define sqr3(int) (int * int * int)
#define pi M_PI
#define nl "\n"

void solve(){
	int a;
	cin >> a;
	string s[a];
	for(int i = 0; i<a; i++){
		int x,y,z,w;
		cin >> x >> y >> z >> w;
		int mx1 = max(x,y);
		int mx2 = max(z,w);
		int mn1 = min(x,y);
		int mn2 = min(z,w);
		if(mx1 == mx2 && mn1 + mn2 == mx1){
			cout << "Yes" << nl;
		}
		else{
			cout << "No" << nl;
		}
	}}

int main(){
	ios::sync_with_stdio();
	cin.tie(0);
	solve();

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
#define sqr(int) (int * int)
#define sqr3(int) (int * int * int)
#define pi M_PI
#define nl "\n"

void solve(){
	int a;
	cin >> a;
	string s[a];
	for(int i = 0; i<a; i++){
		int x,y,z,w;
		cin >> x >> y >> z >> w;
		float sq = sqrt((x*y) + (z*w));
		if(int(sq) != sq){
			s[i] = "No";
		}
	    if(int(sq) == sq){
			s[i] = "Yes";
		}}
		for(int i = 0;i<a; i++){
			cout << s[i] << nl;
		}

	}

int main(){
	ios::sync_with_stdio();
	cin.tie(0);
	solve();

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
#define sqr(int) (int * int)
#define sqr3(int) (int * int * int)
#define pi M_PI
#define nl "\n"

  int main(){
	ios::sync_with_stdio(true);
	cin.tie(0);
    int a;
    cin >> a;
    string ans[a];
    for(int i = 0;i<a; i++){
		int x,y,z,q;
		cin >> x >> y;
		cin >> z >> q;
		x*=y;
		z*=q;
		if(sqrt(x+z) * sqrt(x+z) == x+z){
			ans[i] = "YES";
		}
		else{
			ans[i] = "NO";
		}
	}

    for(int i = 0; i<a; i++){
		cout << ans[i] << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
#define sqr(int) (int * int)
#define sqr3(int) (int * int * int)
#define pi M_PI
#define nl "\n"

void solve(){
	int n;
	cin >> n;
	int a,b,c,d;
	string ans[n];
	for(int i = 0; i<n; i++){
		ans[i]="No";
		int a,b,c,d;
		cin >> a >> b >> c >> d;
		int mx1 = max(a,b);
		int mx2 = max(c,d);
		int min1 = min(a,b);
		int min2 = min(c,d);
		if(mx1 == mx2){
			if(min1 + min2 == mx1){
			ans[i] = "Yes";}
			if(min1+min2 == mx2){
				ans[i] = "Yes";
			}
		}
		if(a == b == c == d){
			ans[i] = "Yes";
		}
	}

	for(int i = 0; i<n; i++){
		cout << ans[i] << nl;
	}

}

int main(){
	ios::sync_with_stdio();
	cin.tie(0);
	solve();

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
#define sqr(int) (int * int)
#define sqr3(int) (int * int * int)
#define pi M_PI
#define nl "\n"

  int main(){
	ios::sync_with_stdio(true);
	cin.tie(0);
    int a;
    cin >> a;
    string ans[a];
    for(int i = 0;i<a; i++){
		int x,y,z,q;
		cin >> x >> y;
		cin >> z >> q;
		x*=y;
		z*=q;
		if(sqrt(x+z) * sqrt(x+z) != x+z){
			ans[i] = "NO";
		}
		else{
			ans[i] = "YES";
		}
	}

    for(int i = 0; i<a; i++){
		cout << ans[i] << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
#define sqr(int) (int * int)
#define sqr3(int) (int * int * int)
#define pi M_PI
#define nl "\n"

  int main(){
	ios::sync_with_stdio(true);
	cin.tie(0);
    int a,x1,y1,x2,y2,sum = 0;
    cin >> a;
    string ans[a];
    for(int i = 0; i<a; i++){
		sum = 0;
		cin >> x1 >> y1;
		cin >> x2 >> y2;
		if(x1 == x2 || x1 == y2 ){
			sum += 1;
			}
		if(y1 == x2 || y1 == y2){
			sum += 1;
		}

		if(sum < 2){
			ans[i] = "YES";
		}
		else{
			ans[i] = "NO";
		}
	}
		for(int i = 0; i<a; i++){
			cout << ans[i] << endl;
		}

	}


#include<bits/stdc++.h>
using namespace std;
bool ifsquare(int a,int b,int c,int d)
{
	if(a>b)
	{
		if(a==c and b+d==a)
			return true;
		else if(a==d and b+c==a)
			return true;
		return false;
	}
	else if(a<b)
	{
		if(b==c and a+d==b)
			return true;
		else if(b==d and b+c==a)
			return true;
		return false;
	}
	return false;
}
int main()
{
	int a,T,b,c,d;
	cin>>T;
	for(int i=0;i<T;i++)
	{
		cin>>a>>b;
		cin>>c>>d;
		if(ifsquare(a,b,c,d))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
bool ifsquare(int a,int b,int c,int d)
{
	if(a!=c and a!=d and b!=c and b!=d)
		return false;
	if(a==c and b+d!=a)
		return false;
	else if(a==d and b+c!=a)
		return false;
	else if(b==c and a+d!=b)
		return false;
	else if(b==d and a+c!=b)
		return false;
	return true;
}
int main()
{
	int a,T,b,c,d;
	cin>>T;
	for(int i=0;i<T;i++)
	{
		cin>>a>>b;
		cin>>c>>d;
		if(ifsquare(a,b,c,d))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
bool ifsquare(int a,int b,int c,int d)
{
	if(a!=c and a!=d and b!=c and b!=d)
		return false;
	if (a==c and a>=b and b+d!=a)
		return false;
	else if(a==d and a>=b and b+c!=a)
		return false;
	else if(b==c and b>=a and a+d!=b)
		return false;
	else if(b==d and b>=a and a+c!=b)
		return false;
	return true;
}
int main()
{
	int a,T,b,c,d;
	cin>>T;
	for(int i=0;i<T;i++)
	{
		cin>>a>>b;
		cin>>c>>d;
		if(ifsquare(a,b,c,d))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
bool ifsquare(int a,int b,int c,int d)
{
	if(a>b)
	{
		if(a==c and b+d==a)
			return true;
		else if(a==d and b+c==a)
			return true;
		return false;
	}
	else if(a<b)
	{
		if(b==c and a+d==b)
			return true;
		else if(b==d and a+c==b)
			return true;
		return false;
	}
	return false;
}
int main()
{
	int a,T,b,c,d;
	cin>>T;
	for(int i=0;i<T;i++)
	{
		cin>>a>>b;
		cin>>c>>d;
		if(ifsquare(a,b,c,d))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
bool ifsquare(int a,int b,int c,int d)
{
	if(a!=c and a!=d and b!=c and b!=d)
		return false;
	if (a==c and a>b and b+d!=a)
		return false;
	else if(a==d and a>b and b+c!=a)
		return false;
	else if(b==c and b>a and a+d!=b)
		return false;
	else if(b==d and b>a and a+c!=a)
		return false;
	return true;
}
int main()
{
	int a,T,b,c,d;
	cin>>T;
	for(int i=0;i<T;i++)
	{
		cin>>a>>b;
		cin>>c>>d;
		if(ifsquare(a,b,c,d))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}


#include <bits/stdc++.h>
#include<iostream>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;

   if(a1==a2){
          if(b1+b2==a2)cout<<"Yes"<<endl;
          else{
                 cout<<"No"<<endl;
          }
   }
   else if(a1==b2){
             if(a2+b1==a1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
          }
   }
   else if(b1==a2){
          if(a2+b2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
             }
   }
   else if(b1==b2){
                if(a1+a2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
             }
   }
   else{
                  cout<<"No"<<endl;
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>
#include<cmath>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;
   int a=0,s,f=0,p;
   if(a1==b1 || a2==b2){
                  cout<<"No"<<endl;
   }
   else{
           if(a1!=a2 && a1!=b2 && b1!=a2 && b1!=b2){
                          f=1;
           }

         a=a1*b1+a2*b2;
         p=a1+a2+b1+b2;
         s=sqrt(a);
         if(s*s==a && f==0 && p%4==0)cout<<"Yes"<<endl;
         else{
                        cout<<"No"<<endl;
         }
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;

   if(a1==a2){
          if(b1+b2==a2)cout<<"Yes"<<endl;
          else{
                 cout<<"No"<<endl;
          }
   }
   else if(a1==b2){
             if(a2+b1==a1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
          }
   }
   else if(b1==a2){
          if(a1+b2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
             }
   }
   else if(b1==b2){
                if(a1+a2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
             }
   }
   else{
                  cout<<"No"<<endl;
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>
#include<cmath>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;
   int a=0,s,f=0;
   if(a1==b1 || a2==b2){
                  cout<<"No"<<endl;
   }
   else{
           if(a1!=a2 && a1!=b2 && b1!=a2 && b1!=b2){
                          f=1;
           }

         a=a1*b1+a2*b2;
         s=sqrt(a);
         if(s*s==a && f==0)cout<<"Yes"<<endl;
         else{
                        cout<<"No"<<endl;
         }
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;
   int f=0;
   if(a1==a2){
          if(b1+b2==a2){
                         f=1;
          }
   }
   if(a1==b2){
             if(a2+b1==a1){
                            f=1;
             }
   }
   if(b1==a2){
          if(a1+b2==b1){
                         f=1;
          }
   }
   if(b1==b2){
                if(a1+a2==b1){
                               f=1;
                }
   }
   if(f==1)cout<<"Yes"<<endl;
   else{
                  cout<<"No"<<endl;
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;

   if(a1==a2){
          if(b1+b2==a2)cout<<"Yes"<<endl;
          else{
                 cout<<"No"<<endl;
          }
   }
   else if(a1==b2){
             if(a2+b1==a1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
          }
   }
   else{
                  cout<<"No"<<endl;
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>
#include<cmath>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;
   int a=0,s,f=0,p;
   if(a1==b1 || a2==b2){
                  cout<<"No"<<endl;
   }
   else{
           if(a1!=a2 && a1!=b2 && b1!=a2 && b1!=b2){
                          f=1;
           }

         a=a1*b1+a2*b2;
         p=a1+a2+b1+b2;
         s=sqrt(a);
         if(s*s==a && f==0 && p%3==0)cout<<"Yes"<<endl;
         else{
                        cout<<"No"<<endl;
         }
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;

   if(a1==a2){
          if(b1+b2==a2)cout<<"Yes"<<endl;
          else{
                 cout<<"No"<<endl;
          }
   }
   else if(a1==b2){
             if(a2+b1==a1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
          }
   }
   else if(b1==a1){
          if(a2+b2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
             }
   }
   else if(b1==b2){
                if(a1+a2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
             }
   }
   else{
                  cout<<"No"<<endl;
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>
#include<math>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;
   int a=0,s;
   if(a1==b1 || a2==b2){
                  cout<<"No"<<endl;
   }
   else{
         a=a1*b1+a2*b2;
         s=sqrt(a);
         if(s*s==a)cout<<"Yes"<<endl;
         else{
                        cout<<"No"<<endl;
         }
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>
#include<cmath>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;
   int a=0,s;
   if(a1==b1 || a2==b2){
                  cout<<"No"<<endl;
   }
   else{
         a=a1*b1+a2*b2;
         s=sqrt(a);
         if(s*s==a)cout<<"Yes"<<endl;
         else{
                        cout<<"No"<<endl;
         }
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include<iostream>

using namespace std;

#define ar array
#define ll long long

const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;

void solve() {
   int a1,b1,a2,b2;
   cin>>a1>>b1;
   cin>>a2>>b2;

   if(a1==a2){
          if(b1+b2==a2)cout<<"Yes"<<endl;
          else{
                 cout<<"No"<<endl;
          }
   }
   else if(a1==b2){
             if(a2+b1==a1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
          }
   }
   else if(b1==a1){
          if(a2+b2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
   }
   else if(b1==b2){
                if(a1+a2==b1)cout<<"Yes"<<endl;
             else{
                 cout<<"No"<<endl;
   }
   else{
                  cout<<"No"<<endl;
   }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <cmath>
#include <iostream>

using namespace std;

void solve(){
    long double a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (sqrt(a*b+c*d) == int(sqrt(a*b+c*d))){
        cout << "Yes" << '\n';
    }
    else{
        cout << "No" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <cmath>
#include <iostream>

using namespace std;

void solve(){
    long double a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (sqrt((a*b)+(c*d)) == int(sqrt((a*b)+(c*d))) ){
        cout << "YES" << '\n';
    }
    else{
        cout << "NO" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <cmath>
#include <iostream>

using namespace std;

void solve(){
    long double a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (a>b) swap(a, b);
    if (c>d) swap(c, d);
    if (b == d && a+c == b){
        cout << "YES" << '\n';
    }
    else{
        cout << "NO" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <cmath>
#include <iostream>

using namespace std;

void solve(){
    long double a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (a>b) swap(a, b);
    if (c>d) swap(c, d);
    if (b == d && a+c == b){
        cout << "YES" << '\n';
    }
    else{
        cout << "NO" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false), cin.tie(NULL);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <cmath>
#include <iostream>

using namespace std;

void solve(){
    long long int a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (a>b) swap(a, b);
    if (c>d) swap(c, d);
    if (b == d && a+c == b){
        cout << "YES" << '\n';
    }
    else{
        cout << "NO" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <cmath>
#include <iostream>

using namespace std;

void solve(){
    long double a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (a>b) swap(a, b);
    if (c>d) swap(c, d);
    if (b == d && a+c == b){
        cout << "YES" << '\n';
    }
    else{
        cout << "NO" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


//https://codeforces.com/contest/1351/submission/79280025

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
//increase stack size
#pragma comment(linker, "/STACK:16777216")

ll mxm() {return LLONG_MIN;}
template<typename... Args>
ll mxm(ll a, Args... args) { return max(a,mxm(args...)); }

ll mnm() {return LLONG_MAX;}
template<typename... Args>
ll mnm(ll a, Args... args) { return min(a,mnm(args...)); }

template<class T> ostream& operator<<(ostream& os,vector<T> V){
	os<<"[ ";for(auto v:V)os<<v<<" ";return os<<"]";
}
template<class L,class R> ostream& operator<<(ostream& os,pair<L,R> P){
	return os<<"("<<P.first<<","<<P.second<<")";
}

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__,__VA_ARGS__)
template<typename Arg1>
void __f(const char* name,Arg1&& arg1){
	cout<<name<<" : "<<arg1<<endl;
}
template <typename Arg1,typename... Args>
void __f(const char* names,Arg1&& arg1,Args&&... args){
	const char* comma=strchr(names+1,',');cout.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1,args...);
}
#else
#define trace(...) 1
#endif

#define ld long double
#define pll pair<ll,ll>
#define ii pair<int,int>
#define vll vector<ll>
#define vii vector<ii>
#define vi vector<int>
#define vpll vector<pll>
#define vld vector<ld>
#define vvld vector<vld>
#define vvi vector<vi>
#define vvll vector<vll>
#define vvpll vector<vpll>
#define vvii vector<vii>
#define I insert
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(x)	x.begin(),x.end()

const int mod=1e9+7;
// 128 bit: __int128
inline int add(int a,int b){a+=b;if(a>=mod)a-=mod;return a;}
inline int sub(int a,int b){a-=b;if(a<0)a+=mod;return a;}
inline int mul(int a,int b){return (a*1ll*b)%mod;}
inline int power(int a,int b){int rt=1;while(b>0){if(b&1)rt=mul(rt,a);a=mul(a,a);b>>=1;}return rt;}
inline int inv(int a){return power(a,mod-2);}

struct compare{
	bool operator() (const int &a,const int &b) const{
		return a>b;
	}
};

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);cout<<setprecision(25);
	int t;cin >> t;
	while(t--){
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		bool poss = 0;
		if((a == c && b + d == a) || (a == d && b + c == a))
			poss = 1;
		swap(a, b);
		if((a == c && b + d == a) || (a == d && b + c == a))
			poss = 1;
		if(poss)
			cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <bits/stdc++.h>

using namespace std;

void solve(){
    long double a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (a>b) swap(a, b);
    if (c>d) swap(c, d);
    if (b == d && a+c == b){
        cout << "YES" << '\n';
    }
    else{
        cout << "NO" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


//                               //
    //    author :  S4M4R    //
    // 22:39:22 | 06-10-2020 //
//                               //

#include <cmath>
#include <iostream>

using namespace std;

void solve(){
    long double a, b, c, d;
    cin >> a >> b; cin >> c >> d;
    if (sqrt((a*b)+(c*d)) == int(sqrt((a*b)+(c*d))) ){
        cout << "YES" << '\n';
    }
    else{
        cout << "N0" << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    cin >> t;
    while(t--) solve();

    return 0;
}


#include<iostream>
using namespace std;

#include <algorithm>

int main()
{
    unsigned int t;
    cin >> t;

    unsigned int a1,b1,a2,b2;

    while(t != 0)
    {
        if(max(a1,b1)==max(a2,b2) && min(a1,b1)+min(a2,b2) == max(a1,b1))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
        t = t-1;
    }
    return 0;
}


#include<iostream>
using namespace std;

#include <algorithm>

int main()
{
    unsigned int t;
    cin >> t;

    unsigned int a1,b1,a2,b2;

    while(t != 0)
    {
        if((max(a1,b1)==max(a2,b2))&&(min(a1,b1)+min(a2,b2) == max(a1,b1))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
        t = t-1;
    }
    return 0;
}


#include<iostream>
#include<cmath>
using namespace std;

int main()
{
    unsigned int t;
    cin >> t;

   unsigned int a1,b1,a2,b2;
    unsigned int area,root;
    while(t != 0)
    {
        cin >> a1 >> b1 ;
        cin >> a2 >> b2 ;

        area = (int)(a1*b1)+(a2*b2);

        root = (unsigned int)sqrt((double)area);
        if(area == (root*root) || area == (root+1)*(root+1))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" <<endl;
        }
       t = t - 1;
    }

    return 0;
}


#include<iostream>
#include<cmath>
using namespace std;

int main()
{
    unsigned int t;
    cin >> t;

   unsigned int a1,b1,a2,b2;
    unsigned int area,root;
    while(t != 0)
    {
        cin >> a1 >> b1 ;
        cin >> a2 >> b2 ;

        area = (int)((a1*b1)+(a2*b2));

        root = (unsigned int)sqrt((double)area);
        if(sqrt(area)>root)
        {
            cout << "NO" << endl;
        }
        else
        {
            cout << "YES" <<endl;
        }
       t = t - 1;
    }

    return 0;
}


#include<iostream>
using namespace std;

#include <algorithm>

int main()
{
    unsigned int t;
    cin >> t;

    unsigned int a1,b1,a2,b2;

    while(t != 0)
    {
        cin >>a1 >>b1>>a2>>b2;
        if((max(a1,b1)==max(a2,b2)) && ((min(a1,b1)+min(a2,b2)) == max(a1,b1)))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
        t = t-1;
    }
    return 0;
}


#include<iostream>
#include<cmath>
using namespace std;

int main()
{
    unsigned int t;
    cin >> t;

   unsigned int a1,b1,a2,b2;
    unsigned int area,root;
    while(t != 0)
    {
        cin >> a1 >> b1 ;
        cin >> a2 >> b2 ;

        area = (int)((a1*b1)+(a2*b2));

        root = (unsigned int)sqrt((double)area);
        if(area == (root*root) || area == (root+1)*(root+1))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" <<endl;
        }
       t = t - 1;
    }

    return 0;
}


#include<iostram>
#include<cmath>
using namespace std;

int main()
{
    unsigned int t;
    cin >> t;

   unsigned int a1,b1,a2,b2;
    unsigned int area,root;
    while(t != 0)
    {
        cin >> a1 >> b1 ;
        cin >> a2 >> b2 ;

        area = (int)(a1*b1)+(a2*b2);

        root = (unsigned int)sqrt((double)area);
        if(area == (root*root) || area == (root+1)*(root+1))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" <<endl;
        }
       t = t - 1;
    }

    return 0;
}


#include<iostream>
using namespace std;

#include <algorithm>

int main()
{
    unsigned int t;
    cin >> t;

    unsigned int a1,b1,a2,b2;

    while(t != 0)
    {
        if((max(a1,b1)==max(a2,b2)) && ((min(a1,b1)+min(a2,b2)) == max(a1,b1)))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
        t = t-1;
    }
    return 0;
}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt,mx, n ,cn, x,b , h, cum , y,t, ans,z,res, mnn = 1e9, q, l, o, n1, g,mn = 1e9, i,mxx;
pair<int, int>p[N];
string s,c,c1,c2,s1,s2, s3,s4;
vector<ll>v,v1;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a;
map<ll, ll>mp;
int used[N];
bool tr;

int main()
{
    ios_base::sync_with_stdio(0);
        cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n;
       for( int i = 0; i < n; i ++ )
       {
           v.clear();
           for( int y = 0; y < 4; y ++ )
               cin >> x,v.pb( x );
             sort( v.begin(), v.end() );

           cnt = v[0] +v[1];
           if( cnt == v[2] && cnt == v[3] )
                cout << "Yes\n";
           else
            cout << "No\n";
        }

}