#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return power((a * a), (b) / 2);
  else
    return (a * power((a * a), (b - 1) / 2));
}
int main() {
  long long t;
  scanf("%lld", &t);
  while (t--) {
    long long n;
    scanf("%lld", &n);
    long long a[n + 5], pos[n + 5];
    vector<long long> v;
    for (long long i = 1; i < n + 1; i++) {
      scanf("%lld", &a[i]);
      pos[a[i]] = i;
    }
    long long first = 1, limit = n;
    for (int i = 1; i <= n;) {
      long long curr = pos[i], val = i;
      while (curr <= limit) {
        if (a[curr] != val) {
          first = 0;
          break;
        }
        curr++;
        val++;
      }
      if (first == 0) break;
      limit = pos[i] - 1;
      i = val;
    }
    if (first)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
