#include <bits/stdc++.h>
const int mod = 1e9 + 7;
using namespace std;
void solve() {
  int n;
  cin >> n;
  int p[n];
  int invp[n];
  for (int i = 0; i < (int)n; i++) {
    cin >> p[i];
    invp[p[i] - 1] = i;
  }
  int t = 0;
  int newstart, prev_end = n - 1;
  while (t < n) {
    newstart = invp[t];
    for (int i = 0; i < (int)prev_end - newstart + 1; i++) {
      if (p[newstart + i] == t + 1) {
        t++;
      } else {
        cout << "No"
             << "\n";
        return;
      }
    }
    prev_end = newstart - 1;
  }
  cout << "Yes"
       << "\n";
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int test;
  cin >> test;
  while (test--) {
    solve();
  }
  return 0;
}
