#include <bits/stdc++.h>
using namespace std;
int n, m;
int s[300000], flag = 0, hh, sum;
void init() {
  memset(s, 0, sizeof(s));
  flag = 0;
  sum = 1;
  m = n;
}
int main() {
  int a, b, c, t;
  cin >> t;
  while (t--) {
    cin >> n;
    init();
    for (a = 1; a <= n; a++) cin >> b, s[b] = a;
    for (; sum <= n;) {
      hh = 0;
      if (s[sum] == m)
        sum++, m--;
      else {
        b = sum;
        for (a = s[sum]; a <= m && b <= n; a++) {
          if (s[b] != a) {
            flag = true;
            break;
          }
          b++;
          hh++;
        }
        if (flag == true)
          break;
        else {
          sum += hh;
          m -= hh;
        }
      }
    }
    if (!flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
