#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<pair<long long, long long> > vec;
    long long num, i;
    for (i = 0; i < n; i++) {
      cin >> num;
      vec.push_back(make_pair(num, i + 1));
    }
    long long flag = 0, pre, last = n;
    sort(vec.begin(), vec.end());
    for (i = 0; i < n; i++) {
      pre = i;
      if (vec[i].second == last) {
        last--;
      } else {
        i++;
        for (; i < n; i++) {
          if (vec[i - 1].second + 1 != vec[i].second) flag = 1;
          if (vec[i].second == last) {
            last = vec[pre].second - 1;
            break;
          }
        }
      }
    }
    if (flag)
      cout << "No" << '\n';
    else
      cout << "Yes" << '\n';
  }
}
