#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> p(n + 1);
  for (long long i = 1; i < n + 1; i++) {
    long long x;
    cin >> x;
    p[x] = i;
  }
  multiset<pair<long long, long long> > k;
  vector<long long> ct(n + 1, 1);
  for (long long i = 1; i < n + 1; i++) k.insert({1, i});
  for (long long i = 1; i < n + 1; i++) {
    long long pos = p[i];
    if (ct[pos] != k.rbegin()->first) {
      cout << "No" << '\n';
      return;
    }
    k.erase({ct[pos], pos});
    auto it = k.upper_bound({ct[pos], pos});
    if (it == k.end()) continue;
    long long newpos = it->second;
    k.erase(it);
    ct[newpos] += ct[pos];
    k.insert({ct[newpos], newpos});
  }
  cout << "Yes" << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long TESTS = 1;
  cin >> TESTS;
  while (TESTS--) {
    solve();
  }
  return 0;
}
