#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    int n;
    cin >> n;
    vector<int> pos(n + 1);
    vector<int> arr(n);
    for (int j = 0; j < n; ++j) {
      cin >> arr[j];
      pos[arr[j]] = j;
    }
    set<int> free;
    multiset<int> lens;
    map<int, int> st;
    bool failed = false;
    for (int j = n; j > 0; --j) {
      int cur_pos = pos[j];
      auto next_it = free.upper_bound(cur_pos);
      auto prev_it = free.upper_bound(cur_pos);
      int cur_len;
      int prev_pos;
      if (prev_it == free.begin()) {
        prev_pos = -1;
      } else {
        --prev_it;
        prev_pos = *prev_it;
      }
      cur_len = cur_pos - prev_pos;
      if (next_it != free.end()) {
        int next_pos = *next_it;
        int pp = st[next_pos];
        int np = pp - cur_len;
        st[next_pos] = np;
        lens.erase(lens.find(pp));
        lens.insert(np);
      }
      free.insert(cur_pos);
      lens.insert(cur_len);
      st[cur_pos] = cur_len;
      int mx = *(--lens.end());
      if (mx > cur_len) {
        failed = true;
        break;
      }
    }
    if (!failed) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
