#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q, n;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    long long arr[n];
    long long sek[n + 1];
    long long sek_sol = n;
    vector<bool> sel(n, 0);
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      sek[arr[i]] = i;
    }
    long long ind = sek[1];
    long long prevseksol = ind;
    sek_sol = n;
    bool res = true;
    for (int i = 2; i <= n; i++) {
      long long nxt = sek[i];
      if (ind + 1 == n || ind + 1 == sek_sol) {
        sek_sol = prevseksol;
        prevseksol = nxt;
        ind = nxt;
      } else {
        if (nxt != ind + 1) {
          res = false;
          break;
        } else {
          ind = nxt;
        }
      }
    }
    if (res) {
      cout << "Yes";
    } else {
      cout << "No";
    }
    cout << '\n';
  }
  return 0;
}
