#include <bits/stdc++.h>
using namespace std;
int T, n, b[100010], mp[100010], hah[100010];
struct qwq {
  int v, id;
} a[100010];
bool cmp(qwq x, qwq y) { return x.v < y.v; }
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
      scanf("%d", &a[i].v), mp[a[i].v] = i, b[i] = a[i].v, hah[i] = 0;
    sort(a + 1, a + n + 1, cmp);
    bool flag = true;
    for (int i = 1; i <= n;) {
      int now = mp[i], js = i;
      hah[now] = 1;
      for (int j = now + 1; j <= n; j++) {
        if (hah[j]) {
          break;
        }
        if (b[j] != b[j - 1] + 1) {
          flag = false;
          break;
        } else {
          hah[j] = 1;
          js++;
        }
      }
      if (!flag) {
        break;
      }
      i = js + 1;
    }
    if (flag)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
