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