#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
void solve() {
  long long n;
  cin >> n;
  long long arr[n + 1];
  long long pos[n + 1];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    pos[arr[i]] = i;
  }
  long long cur = -1;
  bool vis[n + 1];
  memset(vis, false, sizeof(vis));
  vis[n] = true;
  for (long long i = 1; i < n + 1; i++) {
    if (cur == -1) {
      cur = pos[i];
    } else {
      if (cur != pos[i]) {
        cout << "No";
        return;
      }
    }
    vis[cur] = true;
    cur = cur + 1;
    if (vis[cur]) {
      cur = -1;
    }
  }
  cout << "Yes";
}
signed main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
    cout << '\n';
  }
  return 0;
}
