#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, x;
  cin >> n;
  vector<long long> v(n + 2), a(n + 2);
  for (long long i = 0; i < n; i++) {
    cin >> x;
    a[x] = i;
    v[i] = 1;
  }
  v[n] = 1;
  long long mx = 1;
  string ans = "Yes";
  for (long long i = 1; i < n + 1; i++) {
    if (v[a[i]] == mx) {
      v[a[i]] = -1;
      if (v[a[i] + 1] > 0 && a[i] + 1 < n) {
        v[a[i] + 1]++;
        mx = v[a[i] + 1];
      } else
        mx = 1;
    } else {
      ans = "NO";
      break;
    }
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
