#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long sq(long long x) { return 1LL * x * x; }
void solve() {
  long long n, k, l, h, x, y, z, w, b, c, d, mini, maxi = INT_MAX, prev;
  cin >> n;
  vector<long long> v(n + 1), a(n + 1, 0);
  unordered_map<long long, long long> m;
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
    m[v[i]] = i;
  }
  a[0] = -1;
  a[m[1]] = -1;
  for (long long i = 2; i <= n - 1; i++) {
    if (lower_bound(a.begin() + m[i - 1], a.end(), 0) != a.end()) {
      if (m[i] != m[i - 1] + 1) {
        cout << "No" << endl;
        return;
      }
    }
    a[m[i]] = -1;
  }
  cout << "Yes" << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
