#include "bits/stdc++.h"
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
using ll = long long int;
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

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

	int t; cin >> t;
	while (t--) {
		ll a, b, c; cin >> a >> b >> c;
		bool good = false;
		for (int i = 0; i < 40; ++i) {
			if (a == b and b == c) {
				good = true;
				break;
			}
			int ct = ((a>>i)&1) + ((b>>i)&1) + ((c>>i)&1);
			if (ct == 2) {
				if (((a>>i)&1) == 0) a += 1LL<<i;
				if (((b>>i)&1) == 0) b += 1LL<<i;
				if (((c>>i)&1) == 0) c += 1LL<<i;
			}
			else if (ct == 1) {
				if ((a>>i)&1) a += 1LL<<i;
				if ((b>>i)&1) b += 1LL<<i;
				if ((c>>i)&1) c += 1LL<<i;
			}
			else break;
		}
		if (good) cout << "YES\n";
		else cout << "NO\n";
	}
}