#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 7;
int n, m, a[maxn], p[maxn];
char s[maxn];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      p[a[i]] = i;
    }
    bool flag = true;
    int l = 1, r = n, now = 1, last = -1, cnt = 0;
    while (now <= n) {
      int now_pos = p[now];
      if (last == -1) {
        if (now_pos == r) {
          cnt = 0;
          last = -1;
          r -= 1;
        } else {
          last = now_pos;
          ++cnt;
        }
      } else {
        if (now_pos != last + 1) {
          flag = false;
        } else {
          last = now_pos;
          ++cnt;
          if (now_pos == r) {
            last = -1;
            r -= cnt;
            cnt = 0;
          }
        }
      }
      ++now;
    }
    printf("%s\n", flag ? "Yes" : "No");
  }
}
