#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("avx,avx2")
using namespace std;
int main() {
  cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    vector<pair<int, int> > b;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      b.push_back({a[i], i});
    }
    sort(b.begin(), b.end());
    string ans = "yes\n";
    for (auto p : b) {
      int v = p.first, i = p.second;
      if (v < n && i + 1 < n && a[i + 1] - a[i] > 1) {
        ans = "no\n";
      }
    }
    cout << ans;
  }
  return 0;
}
