#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  for (int j = 0; j < t; j++) {
    long long n, f, n1, l, s = 0;
    cin >> n;
    long long p[n];
    for (int i = 0; i < n; i++) {
      cin >> p[i];
    }
    f = 0;
    n1 = n;
    l = p[0];
    s = l;
    if (l == n) {
      n = l - 1;
      s = p[1];
    }
    for (int i = 1; i < n1; i++) {
      l = p[i];
      if (l == n) {
        n = s - 1;
        s = p[i + 1];
      } else {
        if (p[i] != p[i + 1] - 1 && p[i] != n) {
          f = 1;
        }
      }
    }
    if (f == 1)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
