#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
const int MAX = 1e5 + 7, MOD = 1e9 + 7;
void solve() {
int n; cin >> n;
std::vector<int> v(n), v2(n);
for (int i = 1; i <= n; i++)
v[i - 1] = i;
for (int i = 1; i <= n; i++) {
cin >> v2[i - 1];
}
if (is_permutation(v.begin(), v.end(), v2.begin()) == true) {
cout << "YES\n";
} else {
cout << "NO\n";
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int t = 1;
cin >> t;
for (int tc = 1; tc <= t; tc++) {
//cout<<"case "<<tc<<": ";
solve();
}
return 0;
}