#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long n, i, j, k, f, a[100001] = {0}, pos[100001] = {0}, t, u, v;
  cin >> t;
  while (t--) {
    f = 0;
    set<pair<long long, long long>> s;
    set<long long> s1;
    map<long long, long long> m;
    cin >> n;
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
      s.insert({1, i});
      s1.insert(i);
      m[i] = 1;
    }
    for (i = 1; i <= n; i++) {
      u = (*s.rbegin()).first;
      v = (*s.rbegin()).second;
      if (m[pos[i]] != u)
        f = 1;
      else {
        s.erase({u, pos[i]});
        auto it = s1.upper_bound(pos[i]);
        if (it != s1.end()) {
          s.erase({m[*it], *it});
          m[*it] += m[pos[i]];
          s.insert({m[*it], *it});
        }
        s1.erase({pos[i]});
      }
    }
    if (f)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
