#include <bits/stdc++.h>
using namespace std;
const long long maxs = 2e5 + 4;
const long long mod = 1000000007;
inline long long add(long long a, long long b) {
  long long ADD = (a % mod + b % mod) % mod;
  return ADD;
}
inline long long sub(long long a, long long b) {
  long long SUB = (a - b + mod) % mod;
  return SUB;
}
inline long long mul(long long a, long long b) {
  long long MUL = (a % mod * b % mod) % mod;
  return MUL;
}
long long fastpow(long long x, long long y) {
  long long res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long inv(long long x) { return fastpow(x, mod - 2); }
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  long long x = t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long place[n + 10];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      place[a[i]] = i;
    }
    long long last = n - 1;
    long long id = place[1];
    long long ff = 1;
    long long times = n;
    long long cur = 1;
    long long num = 1;
    while (times--) {
      if (a[id] != cur) {
        ff = 0;
        break;
      }
      if (id == last) {
        last = place[num] - 1;
        num = cur + 1;
        id = place[1 + cur];
      } else {
        id++;
      }
      cur++;
    }
    if (ff)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
