#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 9;
const long long inf = 1e18 + 18;
const int max6 = 1e6 + 6;
int a[max6], pos[max6], pre[max6], ne[max6];
map<int, int> cnt;
multiset<int> s;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i], pos[a[i]] = i;
    for (int i = 1; i <= n; ++i) {
      pre[i] = i - 1;
      ne[i] = i + 1;
    }
    cnt.clear();
    s.clear();
    bool ok = true;
    for (int i = 1; i <= n; ++i) s.insert(1), cnt[i] = 1;
    for (int i = 1; i <= n; ++i) {
      int id = pos[i];
      int gmax = *s.rbegin();
      if (cnt[id] < gmax) {
        ok = false;
        break;
      }
      ne[pre[id]] = ne[id];
      pre[ne[id]] = pre[id];
      cnt[ne[id]] += cnt[id];
      s.erase(s.find(cnt[id]));
      cnt[id] = 0;
      if (ne[id] <= n) s.insert(cnt[ne[id]]);
    }
    cout << (ok ? "YES\n" : "NO\n");
  }
}
