#include <bits/stdc++.h>
using namespace std;
bool solver() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> ind(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
    ind[a[i]] = i;
  }
  int previous = n - 1;
  int previousindex = 0;
  while (previous > 0) {
    int k = ind[previous];
    int r = ind[previous];
    while (previous > 0 && k > previousindex) {
      k--;
      if (a[k] == previous - 1) {
        previous--;
      } else {
        return false;
      }
    }
    previousindex = r + 1;
    previous--;
  }
  return true;
}
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    if (solver()) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
}
