#include <bits/stdc++.h>
using namespace std;
int T, N, P[100000], reP[100000], cnt[100000];
bool sel[100000];
multiset<int> countSet;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> T;
  while (T--) {
    countSet.clear();
    cin >> N;
    for (int j = 0; j < N; ++j) {
      cin >> P[j];
      reP[P[j] - 1] = j;
      countSet.insert(1);
      cnt[j] = 1;
      sel[j] = false;
    }
    bool pos = true;
    for (int j = 0; j < N; ++j) {
      int idx = reP[j];
      int maxcount = *countSet.rbegin();
      if (cnt[idx] != maxcount) {
        pos = false;
        break;
      }
      sel[idx] = true;
      countSet.erase(countSet.find(cnt[idx]));
      if (idx + 1 < N && !sel[idx + 1]) {
        countSet.erase(countSet.find(cnt[idx + 1]));
        cnt[idx + 1] += cnt[idx];
        countSet.insert(cnt[idx + 1]);
      }
    }
    if (pos)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
