#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#include <fstream>
#include <cassert>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define sz(a) int((a).size())
#define rep(i, s, n) for(int i = s; i <= (n); ++i)
#define rev(i, n, s) for(int i = (n); i >= s; --i)
#define fore(x, a) for(auto &&x : a)
typedef long long ll;
const int mod = 1000000007;
const int N = 100005;
map<int, int> a;
int main() {
#ifdef loc
if(!freopen((string(FOLDER) + "inp.txt").c_str(), "r", stdin)) {
assert(0);
}
freopen((string(FOLDER) + "out.txt").c_str(), "w", stdout);
#endif
boost;
int t;
cin >> t;
while (t-- > 0) {
int n;
cin >> n;
a.clear();
rep(i, 1, n) {
int x;
cin >> x;
a[x]++;
}
int three = 0, two = 0;
fore(x, a) {
if (x.second >= 3) three++;
if (x.second == 2) two++;
}
if (three || (two >= 2)) {
cout << "YES";
}
else cout << "NO";
cout << '\n';
}
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxkZXF1ZT4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RhY2s+CiNpbmNsdWRlIDxiaXRzZXQ+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxmdW5jdGlvbmFsPgojaW5jbHVkZSA8bnVtZXJpYz4KI2luY2x1ZGUgPHV0aWxpdHk+CiNpbmNsdWRlIDxzc3RyZWFtPgojaW5jbHVkZSA8aW9zdHJlYW0+CiNpbmNsdWRlIDxpb21hbmlwP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