#include <bits/stdc++.h>
using namespace std;
using big = long long;
const int N = 100200;
int n;
int a[N], pos[N], fa[N], s[N], rep[N];
int gf(int x) {
  if (fa[x] != x) {
    fa[x] = gf(fa[x]);
  }
  return fa[x];
}
void merge(int x, int y) {
  x = gf(x);
  y = gf(y);
  if (x == y) {
    return;
  }
  s[y] += s[x];
  fa[x] = y;
}
void print() {
  for (int i = 1; i <= n; ++i) {
    int res = s[gf(i)];
    if (gf(i) != i) {
      res = 0;
    }
    cerr << res << " ";
  }
  cerr << endl;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int cas;
  cin >> cas;
  while (cas--) {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
      fa[i] = i;
      pos[a[i]] = i;
      s[i] = 1;
    }
    int mx = 1;
    map<int, set<int>> f;
    for (int i = 1; i <= n; ++i) {
      f[s[i]].insert(i);
    }
    fa[n + 1] = n + 1;
    bool ok = true;
    for (int i = 1; i <= n && ok; ++i) {
      mx = f.rbegin()->first;
      if (s[gf(pos[i])] == mx && gf(pos[i]) == pos[i]) {
        f[s[pos[i]]].erase(pos[i]);
        if (f[s[pos[i]]].empty()) {
          f.erase(s[pos[i]]);
        }
        int olds = s[gf(pos[i] + 1)];
        merge(pos[i], pos[i] + 1);
        f[olds].erase(gf(pos[i] + 1));
        if (f[olds].empty()) {
          f.erase(olds);
        }
        if (gf(pos[i] + 1) <= n) {
          f[s[gf(pos[i] + 1)]].insert(gf(pos[i] + 1));
          if (s[gf(pos[i] + 1)] > mx) {
            mx = s[gf(pos[i] + 1)];
          }
        }
      } else {
        ok = false;
      }
    }
    cout << (ok ? "Yes" : "No") << "\n";
  }
}
