#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX = 1123456;
int p[MAX];
void task() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    x--;
    p[x] = i;
  }
  int end = n;
  int next = end;
  int minim = n;
  for (int i = 0; i < n; i++) {
    if (p[i] != next && next != end) {
      printf("No\n");
      return;
    }
    if (next == end) end = minim;
    minim = min(minim, p[i]);
    next = p[i] + 1;
  }
  printf("Yes\n");
}
int main() {
  int n;
  scanf("%d", &n);
  while (n--) task();
  return 0;
}
