#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    vector<long long> index(n);
    for (long long i = 0; i < n; i++) {
      index[a[i] - 1] = i;
    }
    bool hoga = true;
    for (long long i = 0; i < n - 1; i++) {
      if (index[i] < index[i + 1]) {
        if ((index[i + 1] - index[i]) != 1) {
          hoga = false;
        }
      }
    }
    if (hoga) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
