#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long M = 1e9 + 7;
int32_t main() {
  ;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, a;
    cin >> n;
    map<long long, long long> mp;
    for (long long i = 0; i < n; i++) {
      cin >> a;
      mp[a] = i;
    }
    map<long long, long long>::iterator itr;
    long long prev = -1;
    bool flag = true;
    long long last = n + 1;
    for (itr = mp.begin(); itr != mp.end(); itr++) {
      long long cur = itr->first;
      long long cur_pos = itr->second;
      if (prev == -1) {
        prev = cur_pos;
      } else {
        if (cur_pos == prev + 1) {
          prev = cur_pos;
        } else {
          if (cur_pos > last) {
            flag = false;
          } else
            prev = cur_pos;
        }
      }
      if (cur_pos < last) last = cur_pos;
    }
    if (flag == false)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
