#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 100005;
int T, n;
int a[N], dd[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> T;
  while (T--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      a[x] = i;
      dd[i] = 1;
    }
    int casidkljlas = 0;
    bool ok = 1;
    for (int i = 1; i <= n; i++) {
      if (casidkljlas) {
        if (a[i] != casidkljlas) {
          ok = 0;
          break;
        }
      }
      casidkljlas = a[i] + 1;
      if (dd[casidkljlas] == 0) casidkljlas = 0;
      dd[a[i]] = 0;
    }
    for (int i = 1; i <= n; i++) dd[i] = 0;
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
