#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long t = 1;
void solve() {
  int n;
  cin >> n;
  int pos[n + 1];
  for (int x, i = 1; i <= n; i++) {
    cin >> x;
    pos[x] = i;
  }
  int last = -1;
  bool vis[n + 2];
  memset(vis, false, sizeof vis);
  vis[0] = vis[n + 1] = true;
  for (int i = 1; i <= n; i++) {
    last++;
    if (vis[last]) {
      last = pos[i];
      vis[last] = true;
      continue;
    }
    if (last != pos[i]) {
      cout << "NO\n";
      return;
    }
    vis[last] = true;
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
