#include <bits/stdc++.h>
using namespace std;
long double pi = 3.141592653589793238;
set<long long>::iterator it;
multiset<long long>::iterator itr;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n + 1];
    arr[0] = 0;
    long long pos[n + 1];
    pos[0] = 0;
    for (long long i = 1; i <= n; i++) {
      cin >> arr[i];
      pos[arr[i]] = i;
    }
    long long fl = 0;
    long long maxx = n;
    long long i = 1;
    while (i < n) {
      long long x1 = pos[i];
      if (x1 == maxx) {
        i++;
        maxx = maxx - 1;
        continue;
      }
      for (long long j = x1 + 1; j <= maxx; j++) {
        if (arr[j] - arr[j - 1] != 1) {
          fl = 1;
          break;
        }
      }
      i = arr[maxx] + 1;
      maxx = x1 - 1;
      if (fl == 1) {
        break;
      }
    }
    if (fl == 0) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
