#include <bits/stdc++.h>
using namespace std;
multiset<long long> st;
multiset<long long>::iterator it;
long long par[100005], cnt[100005], ara[100005];
long long fnd_par(long long a) {
  if (par[a] == a) return a;
  return par[a] = fnd_par(par[a]);
}
int main() {
  long long test, t, i, j, k, a, b, c, x, y, z;
  long long n, m;
  scanf("%lld", &test);
  for (t = 1; t <= test; t++) {
    scanf("%lld", &n);
    st.clear();
    for (i = 1; i <= n; i++) {
      par[i] = i;
      scanf("%lld", &a);
      ara[a] = i;
      cnt[i] = 1;
      st.insert(1);
    }
    par[0] = 0;
    cnt[0] = 0;
    par[n + 1] = n + 1;
    cnt[n + 1] = 0;
    m = 1;
    for (i = 1; i <= n; i++) {
      a = ara[i];
      b = fnd_par(a);
      it = st.end();
      it--;
      z = *it;
      if (a != b || cnt[b] < z) {
        m = 0;
        break;
      }
      c = fnd_par(a + 1);
      par[b] = c;
      cnt[c] += cnt[b];
      it = st.find(cnt[b]);
      st.erase(it);
      if (c <= n) {
        st.insert(cnt[c]);
      }
    }
    if (m) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
