#include <bits/stdc++.h>
using namespace std;
int T, n, root[100005], leaf[100005], p[100005];
int root_now(int x) {
  if (root[x] != x) return root[x] = root_now(root[x]);
  return root[x];
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    root[n + 1] = n + 1;
    leaf[n + 1] = -200000;
    map<int, int> q;
    q[1] = n;
    int v = 1, a;
    for (int i = 1; i <= n; i++) {
      leaf[i] = 1;
      root[i] = i;
      scanf("%d", &a);
      p[a] = i;
    }
    for (int i = 1; i <= n; i++) {
      a = p[i];
      if (leaf[a] != q.rbegin()->first) {
        v = 0;
        break;
      }
      root[a] = root_now(a + 1);
      leaf[root[a]] += leaf[a];
      q[leaf[root[a]]]++;
      if (!--q[leaf[a]]) q.erase(leaf[a]);
    }
    if (v)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
