#include <bits/stdc++.h>
using namespace std;
int check[100000 + 10];
int ans[100000 + 10];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n, flag = 1, current;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      int a;
      scanf("%d", &a);
      ans[a] = i;
      check[i] = 0;
    }
    check[n + 1] = -1;
    int any = 1;
    for (int i = 1; i <= n; i++) {
      int pos = ans[i];
      if (any) {
        if (check[pos] == -1) flag = 0;
        current = pos;
        check[pos] = -1;
      } else {
        if (current != pos) flag = 0;
        current = pos;
        check[pos] = -1;
      }
      current = current + 1;
      any = 0;
      if (check[current] == -1) any = 1;
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
