#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
const long double pi = 3.141592653589793238;
long long MOD = 1000000007;
const long long N = 1e5 + 10;
long long n, a[N], pos[N];
bool visited[N];
void solve() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i], pos[a[i]] = i, visited[i] = 0;
  long long cnt = 1;
  bool ok = 1;
  visited[n + 1] = 1;
  pos[n + 1] = n + 1;
  while (cnt <= n) {
    long long p = pos[cnt++];
    while (p <= n) {
      visited[p] = 1;
      if (visited[p + 1]) break;
      if (pos[cnt] != p + 1) {
        ok = 0;
        break;
      } else {
        p++;
        cnt++;
      }
    }
    if (!ok) break;
  }
  cout << (ok ? "YES" : "NO") << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
