#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, temp = 0;
    cin >> n;
    int a[n + 5];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n - 1; j++) {
        if (a[i] == a[j + 1]) {
          temp = 1;
          break;
        }
      }
    }
    if (temp == 0) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
    }
  }
  return 0;
}
