#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 1;
int n, k;
int A[MAXN];
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> A[i];
    }
    int pos = n - 1;
    int target = 1;
    bool poss = true;
    while (0 <= pos) {
      int end = A[pos];
      int i = pos;
      for (; 0 <= i; i--) {
        if (i < pos && A[i] != A[i + 1] - 1) {
          poss = false;
          goto exit;
        }
        if (A[i] == target) {
          break;
        }
      }
      pos = i - 1;
      target = end + 1;
    }
  exit:
    if (poss) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
