#include <bits/stdc++.h>
using namespace std;
int t, n, p[100002];
bool id[100002];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      int a;
      scanf("%d", &a);
      p[a] = i;
      id[i] = true;
    }
    id[n + 1] = 0;
    bool succeed = true;
    int num = 1;
    int tp = p[1];
    p[1] = 0;
    id[tp] = 0;
    for (int i = 2; i <= n; i++) {
      if (id[tp + 1] == false) {
        id[p[i]] = false;
        tp = p[i];
      } else {
        if (tp + 1 != p[i]) {
          succeed = false;
          break;
        } else {
          id[tp + 1] = false;
          tp = tp + 1;
        }
      }
    }
    if (succeed)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
