#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  long long int pos[n + 1];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    pos[a[i]] = i;
  }
  long long int f = 0;
  long long int last = n;
  long long int c = 1;
  while (last > 0) {
    long long int q = pos[c++];
    for (long long int i = q + 1; i < last; i++) {
      if (a[i] != c) {
        cout << "No" << '\n';
        return;
      }
      c++;
    }
    last = q;
  }
  cout << "Yes" << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  cin >> t;
  for (long long int i = 0; i < t; i++) {
    solve();
  }
}
