#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int xx[n + 1];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      xx[a[i]] = i;
    }
    int i = 1;
    int start = -1;
    int end = n - 1;
    bool flag = 0;
    while (i < n) {
      start = xx[i];
      if (start == end) {
        end = start - 1;
        start = -1;
        i++;
      } else {
        int zz = start;
        i++;
        while (zz != end and i < n) {
          if (xx[i] != zz + 1) {
            flag = 1;
            break;
          } else {
            zz++;
            i++;
          }
        }
        if (flag == 1)
          break;
        else {
          end = start - 1;
          start = -1;
        }
      }
    }
    if (flag == 1)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
