#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
void solve() {
  int i, j, n, ele;
  cin >> n;
  vector<int> mapping(n + 1), arr(n + 1);
  for (i = 1; i <= n; i++) {
    cin >> ele;
    arr[i] = ele;
    mapping[ele] = i;
  }
  int cur_pos = mapping[1];
  int break_point = n;
  int cur_ele = 1, start_ele = 1;
  while (cur_ele <= n) {
    while (cur_pos <= break_point) {
      if (arr[cur_pos] == cur_ele) {
        ++cur_pos;
        ++cur_ele;
      } else {
        cout << "No\n";
        return;
      }
    }
    cur_pos = mapping[cur_ele];
    break_point = mapping[start_ele] - 1;
    start_ele = cur_ele;
  }
  cout << "Yes\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t, ans, case_no;
  case_no = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
