#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int min(long long int a, long long int b) {
  if (a < b) return a;
  return b;
}
void fastIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int32_t main() {
  fastIO();
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int index[n];
    bool possible = true;
    for (long long int i = 0; i < n; i++) {
      index[i] = -1;
    }
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
      index[arr[i]] = i;
    }
    if (n <= 2) {
      cout << "Yes\n";
      continue;
    }
    long long int last = n - 1;
    long long int no = 1;
    while (no < n) {
      if (index[no] == last) {
        last = n - no - 1;
      } else {
        long long int currentIndex = index[no];
        if (index[no + 1] != currentIndex + 1) {
          possible = false;
          break;
        }
      }
      no++;
    }
    if (possible) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
