#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
const int maxn = 100005;
void solve() {
  priority_queue<pi> q;
  int n;
  cin >> n;
  vi ne(n + 1), t(n + 1, 1);
  for (int i = 0; i < (n + 1); ++i) ne[i] = i + 1;
  for (int i = (1); i <= (n); ++i) q.push(make_pair(t[i], i));
  bool ok = true;
  for (int i = 0; i < (n); ++i) {
    int p;
    cin >> p;
    if (!ok) continue;
    while (q.size() && t[q.top().second] != q.top().first) q.pop();
    assert(!q.empty());
    if (t[p] != q.top().first) {
      ok = 0;
      continue;
    }
    if (ne[p] != n + 1 && t[ne[p]] != -1) {
      t[ne[p]] += 1 + t[p];
      q.push(make_pair(t[ne[p]], ne[p]));
    }
    t[p] = -1;
  }
  if (ok)
    cout << "Yes\n";
  else
    cout << "No\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
