#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    int a[n + 1];
    int p[n + 1];
    int vis[n + 1];
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      p[a[i]] = i;
    }
    int cur = p[1];
    memset(vis, 0, sizeof(vis));
    vis[cur] = 1;
    vis[n + 1] = 1;
    for (int j = 2; j <= n; j++) {
      if (p[j] != cur + 1) {
        if (vis[cur + 1]) {
          cur = p[j];
        } else {
          printf("No\n");
          goto done;
        }
      } else
        cur++;
      vis[cur] = 1;
    }
    printf("Yes\n");
  done:;
  }
}
