#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5 + 7;
const long long mod = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n), pos(n), used(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
    pos[a[i]] = i;
  }
  for (long long i = 0; i < n; i++) {
    if (used[i]) {
      continue;
    }
    long long j = pos[i];
    while (j < n && !used[j]) {
      if (j != pos[i] && a[j] != a[j - 1] + 1) {
        cout << "NO\n";
        return;
      }
      used[j] = 1;
      j++;
    }
  }
  cout << "Yes\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long T = 1;
  cin >> T;
  while (T--) {
    solve();
  }
}
