#include<iostream>#include<vector>#include<map>#include<string>#include<cstring>#include<cstdio>#include<algorithm>#include<set>#include<queue>usingnamespace std;intmain(){int n, m;
cin >> n;for(int i =0; i < n; i++){
cin >> m;
vector<int>v(m+1);bool flag =true;for(int j =1; j <= m; j++){
cin >> v[j];for(int t =1; t < j; t++){if(v[j]== v[t]||abs(v[j]- v[t])==abs(j - t)){
flag =false;break;}}}if(flag)
cout <<"YES"<< endl;else
cout <<"NO"<< endl;}}