#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 9;
const int mod = 1e9 + 7;
long long n, x, t;
vector<long long> v;
string s;
long long i = 0, j = 0, f = 0, k = n;
long long so(long long ind, long long len) {
  long long sta = v[ind] + 1, cnt = 1;
  if (len == 1) return 1;
  for (int h = ind + 1; h < ind + len; h++, sta++) {
    if (v[h] == sta) {
      cnt++;
    }
  }
  if (cnt != len) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> t;
  while (t--) {
    cin >> n;
    v.clear();
    for (int h = 0; h < n; h++) {
      cin >> x;
      v.push_back(x);
    }
    i = 0, j = 0, f = 0, k = n;
    for (; !f && i < n; i++, k--) {
      long long wbs = k + 1 - v[i];
      if (so(i, wbs) == 0) {
        f = 1;
        break;
      } else
        i += (wbs - 1), k -= (wbs - 1);
    }
    (f == 1) ? cout << "NO\n" : cout << "YES\n";
  }
  return 0;
}
