#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
mt19937 rnd(51);
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> ind;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    ind[a[i]] = i;
  }
  long long j = n - 1, now = 1, i = 0;
  while (j >= 0 && a[j] == now) {
    now++;
    j--;
  }
  if (j == -1) {
    cout << "Yes\n";
    return;
  }
  j++;
  while (now <= n) {
    long long i = ind[now], ii = ind[now];
    while (i < j && now <= n) {
      if (a[i] != now) {
        cout << "No\n";
        return;
      }
      i++;
      now++;
    }
    j = ii;
  }
  cout << "Yes\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
