#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v(n);
    long long int a[n + 1];
    for (long long int i = 0; i < n; i++) {
      cin >> v[i];
      a[v[i]] = i;
    }
    long long int c = 1;
    long long int lol = 0;
    while (c <= n) {
      long long int x = a[c];
      for (long long int i = x; i < n; i++) {
        if (v[i] != c) {
          if (v[i] > c) {
            lol = 1;
            break;
          } else {
            break;
          }
        } else {
          c++;
        }
      }
      if (lol == 1) {
        break;
      }
    }
    if (c < n) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
