#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize "-O3"
struct DSU {
  vector<long long> parent, sz;
  DSU(long long n) {
    parent.resize(n, 0);
    sz.resize(n, 1);
    for (int i = 0; i < n; ++i) parent[i] = i;
  }
  long long get(long long node) {
    if (node == parent[node]) return node;
    return parent[node] = get(parent[node]);
  }
  long long get_len(long long node) { return sz[get(node)]; }
  void union_sets(long long a, long long b) {
    a = get(a);
    b = get(b);
    if (a == b) return;
    if (a < b) swap(a, b);
    parent[b] = a;
    sz[a] += sz[b];
  }
};
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    a[x - 1] = i;
  }
  DSU dsu(n);
  vector<bool> used(n, false);
  map<long long, set<long long> > node;
  for (int i = 0; i < n; ++i) {
    node[dsu.get_len(i)].insert(i);
  }
  for (int i = 0; i < n - 1; ++i) {
    long long ind = a[i];
    if (used[ind]) {
      cout << "No" << '\n';
      return;
    }
    if (!(*node.rbegin()).second.count(ind)) {
      cout << "No" << '\n';
      return;
    }
    if (node.rbegin()->second.size() == 1)
      node.erase(--node.end());
    else
      node.rbegin()->second.erase(node.rbegin()->second.find(ind));
    used[ind] = true;
    if (ind + 1 < n) {
      if (dsu.get(ind + 1) < n and used[dsu.get(ind + 1)] == false) {
        node[dsu.get_len(ind + 1)].erase(
            node[dsu.get_len(ind + 1)].find(dsu.get(ind + 1)));
      }
      dsu.union_sets(ind, ind + 1);
      if (dsu.get(ind + 1) < n and used[dsu.get(ind + 1)] == false) {
        node[dsu.get_len(ind + 1)].insert(dsu.get(ind + 1));
      }
    }
  }
  cout << "Yes" << '\n';
  return;
}
int main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
