#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> p(n), pos(n);
    for (long long int i = 0; i < n; i++) {
      cin >> p[i];
      pos[p[i] - 1] = i;
    }
    long long int l = 0, r = n - 1;
    long long int lstart = 0, rend = n;
    bool ispossible = true;
    for (long long int i = 0; i < n;) {
      if (pos[i] >= l && pos[i] <= r) {
        if (pos[i] == r) {
          r--;
          i++;
        } else {
          long long int nextnums = r - pos[i];
          r = pos[i] - 1;
          long long int next = pos[i] + 1;
          i++;
          while (nextnums--) {
            if (pos[i] == next) {
              next++;
              i++;
            } else {
              ispossible = false;
              i = n + 1;
              break;
            }
          }
        }
      } else {
        ispossible = false;
        break;
      }
    }
    cout << (ispossible ? "Yes" : "No") << "\n";
  }
}
