#include <bits/stdc++.h>
using namespace std;
bool checkpermutation(int a[], int n, int e, map<int, int> &m) {
  if (e >= n + 1) return true;
  for (int i = m[e]; i < n - 1; i++) {
    if (a[i + 1] - a[i] != 1) return false;
  }
  return checkpermutation(a, m[e], e + n - m[e], m);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    map<int, int> m;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      m[a[i]] = i;
    }
    if (checkpermutation(a, n, 1, m))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
