#include <bits/stdc++.h>
#pragma optimise GCC(-O2)
using namespace std;
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
  uniform_int_distribution<int> uid(0, lim - 1);
  return uid(rang);
}
long long INF = LLONG_MAX;
const long long M = 1000000007;
long long powm(long long, long long);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long p[n];
    for (int i = 0; i < n; i++) cin >> p[i];
    long long idx[n + 1];
    for (int i = 0; i < n; i++) idx[p[i]] = i;
    long long dist[n];
    for (int i = 0; i < n; i++) dist[i] = 1;
    long long mera_papa_kon[n + 1], mera_bacha_kon[n + 1];
    for (int i = 0; i < n + 1; i++) mera_bacha_kon[i] = i - 1;
    for (int i = 0; i < n + 1; i++) mera_papa_kon[i] = i + 1;
    set<pair<long long, long long>, greater<pair<long long, long long>>>
        distances_to_next_empty;
    for (int i = 0; i < n; i++) distances_to_next_empty.insert({1, i});
    for (int i = 1; i < n + 1; i++) {
      bool flag = 1;
      auto pr = *distances_to_next_empty.begin();
      auto max_dist = pr.first;
      auto itrr = pr.second;
      if (dist[idx[i]] != max_dist) flag = 0;
      if (flag != 1) {
        cout << "No" << endl;
        goto meow;
      }
      itrr = idx[i];
      long long papa = mera_papa_kon[itrr];
      long long bacha = mera_bacha_kon[itrr];
      if (bacha >= 0) mera_papa_kon[bacha] = papa;
      if (papa <= n) mera_bacha_kon[papa] = bacha;
      long long temp = dist[itrr];
      dist[itrr] = 0;
      distances_to_next_empty.erase(pr);
      if (papa == n) continue;
      long long papakdist = dist[papa];
      dist[papa] += temp;
      distances_to_next_empty.erase({papakdist, papa});
      distances_to_next_empty.insert({papakdist + temp, papa});
    }
    cout << "Yes" << endl;
  meow:;
  }
}
long long powm(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % M;
    a = (a * a) % M;
    b >>= 1;
  }
  return res;
}
