#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int d, i, j, k, l, m, n, x = 0, y = 0, z = 0, w;
    cin >> n;
    int a[n + 1], b[n + 1], c[n + 1], r[n + 1];
    unordered_set<int> s;
    unordered_map<int, int> mp;
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      mp[a[i]] = i;
      r[i] = i;
      c[i] = 0;
      s.insert(i);
    }
    bool ok = true;
    x = n;
    for (i = 1; i <= n; i++) {
      if (mp[i] == x) {
        if (ok) {
          x -= 1;
          ok = true;
        } else {
          if (mp[i] == y) {
            x = m - 1;
            ok = true;
          } else {
            z = 1;
          }
        }
      } else {
        if ((mp[i] == y) || (ok)) {
          if (ok) {
            m = mp[i];
            y = mp[i];
          }
          y += 1;
          z = 0;
        } else {
          z = 1;
        }
        ok = false;
      }
      if (z == 1) {
        break;
      }
    }
    if (z == 1) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
    }
  }
}
