#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
bool cmp(pair<string, int> p1, pair<string, int> p2) {
  return p1.second > p2.second;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    map<long long, long long> pk;
    long long cnt[n + 1];
    for (long long i = 0; i < n; ++i) {
      cin >> a[i];
      pk[a[i]] = i;
      cnt[i] = 1;
    }
    long long maxi = 1;
    bool c = 0;
    for (long long j = 1; j <= n; ++j) {
      if (cnt[pk[j]] == maxi) {
        if (pk[j] + 1 == n) {
          cnt[pk[j]] = 0;
          maxi = 1;
        } else {
          if (cnt[pk[j] + 1] == 0) {
            cnt[pk[j]] = 0;
            maxi = 1;
          } else {
            cnt[pk[j] + 1] = cnt[pk[j]] + 1;
            maxi = cnt[pk[j] + 1];
            cnt[pk[j]] = 0;
          }
        }
      } else {
        cout << "NO"
             << "\n";
        c = 1;
        goto end;
      }
    }
  end:;
    if (c) {
      continue;
    } else {
      cout << "YES"
           << "\n";
    }
  };
}
