#include <bits/stdc++.h>
using namespace std;
long long p[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> p[i];
    }
    long long biggest;
    long long lower;
    long long lowest = 1;
    int i = n - 1;
    bool ans = 1;
    while (i >= 0) {
      biggest = p[i];
      lower = biggest - lowest + 1;
      for (int j = i + 1 - (biggest - lowest + 1); j <= i; j++) {
        if (p[j] != lowest) {
          ans = 0;
          break;
        }
        lowest++;
      }
      if (!ans) break;
      i -= lower;
    }
    cout << (ans ? "YES\n" : "NO\n");
  }
}
