#include <bits/stdc++.h>
using namespace std;
void solve(vector<int>& v, int n) {
  stack<int> s;
  s.push(0);
  for (int i = 1; i < n; i++) {
    if (v[i] < v[i - 1]) s.push(i);
  }
  if (v[n - 1] < v[n - 2]) s.push(n - 1);
  int ptr = 1, r = n;
  while (!s.empty()) {
    for (int i = s.top(); i < r; i++) {
      if (v[i] != ptr) {
        cout << "No" << endl;
        return;
      }
      ptr++;
    }
    r = s.top();
    s.pop();
  }
  cout << "Yes" << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto& i : v) cin >> i;
    solve(v, n);
  }
  return 0;
}
