#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> pis(n);
    for (int i = 0; i < n; i += 1) cin >> pis[i];
    map<int, unordered_set<int>> tmap;
    vector<int> rev_map(n + 1, 1);
    list<int> nxt;
    for (int i = 0; i < n + 1; i += 1) nxt.push_back(i);
    unordered_map<int, list<int>::iterator> nxt_map;
    int j = 0;
    for (auto it = begin(nxt); it != end(nxt); it++) {
      nxt_map.emplace(j, it);
      j++;
    }
    for (int i = 1; i < n + 1; i += 1) tmap[1].insert(i);
    bool good = true;
    for (const auto pi : pis) {
      auto it = tmap.rbegin();
      if (it->second.find(pi) == it->second.end()) {
        good = false;
        break;
      }
      it->second.erase(pi);
      if (it->second.empty()) tmap.erase(it->first);
      auto pit = nxt_map[pi], cit = nxt_map[pi];
      cit++;
      int curr = (cit == end(nxt) ? n + 1 : *cit);
      nxt.erase(pit);
      if (curr != n + 1) {
        tmap[rev_map[curr]].erase(curr);
        if (tmap[rev_map[curr]].empty()) tmap.erase(rev_map[curr]);
        rev_map[curr] += rev_map[pi];
        tmap[rev_map[curr]].insert(curr);
      }
      rev_map[pi] = 0;
    }
    if (good)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
