#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= Mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % Mod;
    a = a * a % Mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int N = 500005;
int n, a[N];
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int st = a[1];
  int last = n;
  for (int i = 2; i <= n; i++) {
    if (a[i] == a[i - 1] + 1)
      continue;
    else if (a[i] > a[i - 1] + 1) {
      cout << "No\n";
      return;
    } else {
      if (a[i - 1] != last) {
        cout << "No\n";
        return;
      } else {
        last = st - 1;
        st = a[i];
      }
    }
  }
  cout << "Yes\n";
}
int main() {
  ios::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
