#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
const int mod = 1e9 + 7;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int par[maxn];
int root(int v) { return v == par[v] ? v : par[v] = root(par[v]); }
void solve_case() {
  int n;
  cin >> n;
  vector<int> v(n + 2), pos(n + 2), cnt(n + 2);
  multiset<int> ms;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    par[i] = i;
    pos[v[i]] = i;
    cnt[i] = 1;
    ms.insert(1);
  }
  par[n + 1] = n + 1;
  for (int i = 1; i <= n; i++) {
    int p = pos[i];
    int mx = *prev(ms.end());
    if (cnt[p] != mx) {
      cout << "No" << endl;
      return;
    }
    ms.erase(ms.find(cnt[p]));
    par[p] = root(p + 1);
    if (par[p] != n + 1) {
      ms.erase(ms.find(cnt[par[p]]));
      cnt[par[p]]++;
      ms.insert(cnt[par[p]]);
    }
  }
  cout << "Yes" << endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve_case();
  }
  return 0;
}
