#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n + 1];
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    vector<int> v(n + 1);
    for (int i = 1; i <= n; i++) {
      v[a[i]] = i;
    }
    int l = n - 1;
    int f = 0;
    for (int i = 2; i <= n; i++) {
      if (v[i - 1] + 1 <= n && v[i] != v[i - 1] + 1) {
        if (a[v[i - 1] + 1] > i) {
          f = 1;
          break;
        }
      }
    }
    if (f == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
