#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 1e5 + 10;
ll n;
ll p[N];
ll w[N];
set<ll> s;
multiset<ll> q;
ll a[N];
void solve() {
  cin >> n;
  for (ll i = 0; i < n; ++i) {
    cin >> p[i];
    --p[i];
    w[p[i]] = i;
  }
  fill_n(a, n, 1);
  s.clear();
  q.clear();
  for (ll i = 0; i < n; ++i) {
    s.insert(i);
    q.insert(1);
  }
  for (ll i = 0; i < n; ++i) {
    ll pos = w[i];
    assert(s.count(pos));
    ll cur = a[pos];
    auto it = s.upper_bound(pos);
    s.erase(pos);
    auto tmp = q.find(cur);
    assert(tmp != q.end());
    q.erase(tmp);
    if (q.size() && *q.rbegin() > cur) {
      cout << "No\n";
      return;
    }
    if (it != s.end()) {
      pos = *it;
      tmp = q.find(a[pos]);
      assert(tmp != q.end());
      q.erase(tmp);
      a[pos] += cur;
      q.insert(a[pos]);
    }
  }
  cout << "Yes\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll tn;
  cin >> tn;
  while (tn--) {
    solve();
  }
  return 0;
}
