#include <bits/stdc++.h>
using namespace std;
constexpr int full = 0x7fffffff;
bool is_valid(const vector<int> &idx, const int max_i, const int i) {
  if (max_i < 0) return true;
  if (idx.at(i) == max_i) {
    return is_valid(idx, max_i - 1, i + 1);
  }
  int j;
  for (j = 1; idx.at(i) + j <= max_i; j++) {
    if (idx.at(i + j) != idx.at(i) + j) {
      return false;
    }
  }
  return is_valid(idx, idx.at(i) - 1, i + j);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int Ncases, N;
  cin >> Ncases;
  for (int _case = 0; _case < Ncases; _case++) {
    cin >> N;
    int p;
    vector<int> idx(N, -1);
    for (int i = 0; i < N; i++) {
      cin >> p;
      idx.at(p - 1) = i;
    }
    bool repeat = false;
    for (const int v : idx) {
      if (v == -1) {
        cout << "No" << endl;
        repeat = true;
        break;
      }
    }
    if (!repeat) {
      if (is_valid(idx, N - 1, 0)) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
