#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n;
  m = n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    v[i]--;
  }
  vector<int> pos(n);
  for (int i = 0; i < n; i++) pos[v[i]] = i;
  int curr = 0;
  while (v.size() && v.back() == curr) {
    v.pop_back();
    curr++;
    n--;
  }
  for (int i = curr; v.size();) {
    int p = pos[i];
    int lp = v[pos[i]];
    while (p + 1 < v.size()) {
      if (v[p + 1] - v[p] != 1) {
        cout << "No\n";
        return;
      }
      p++;
    }
    while (v.size() > pos[i]) v.pop_back();
    i = max(lp + (p - pos[i]), i + 1);
  }
  cout << "Yes\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
