#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> p(n + 1), rp(n + 1), o(n + 1);
    for (int i = 1; i <= n; i++) {
      cin >> p[i];
      rp[p[i]] = i;
    }
    bool poss = true;
    int top = n;
    for (int i = 1; i < n - 1; i++) {
      if (rp[i] + 1 <= n && o[rp[i] + 1] == 0 && rp[i + 1] != rp[i] + 1) {
        poss = false;
      } else {
        o[rp[i]] = 1;
      }
    }
    poss ? cout << "YES" : cout << "NO";
    cout << "\n";
  }
  return 0;
}
