暴力
#include<iostream>
using namespace std;
const int N = 1010;
int k, n;
int q[N];
bool isN(int n)
{
for(int i = 0; i < n; i++){
for(int j = 0; j < n && j != i; j++){
if(q[i] == q[j] || abs(q[i] - q[j]) == abs(i - j)) return false;
}
}
}
int main()
{
cin >> k;
while(k --){
cin >> n;
for(int i = 0; i < n; i++) cin >> q[i];
if(isN(n)) cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}