#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n], p[n + 1];
    bool usou[n + 1];
    memset(usou, 0, sizeof usou);
    usou[n] = true;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      p[a[i]] = i;
    }
    int prox = -1;
    bool ok = true;
    for (int i = 1; i <= n; i++) {
      if (prox == -1) {
        usou[p[i]] = true;
        if (!usou[p[i] + 1])
          prox = p[i] + 1;
        else
          prox = -1;
        continue;
      }
      if (prox != p[i]) {
        ok = false;
        break;
      }
      usou[p[i]] = true;
      if (!usou[p[i] + 1])
        prox = p[i] + 1;
      else
        prox = -1;
    }
    if (ok) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
