#include <bits/stdc++.h>
using namespace std;
const int N = 100050;
struct node {
  int l, r;
  bool operator<(const node &b) const {
    if (r - l != b.r - b.l) return r - l < b.r - b.l;
    return l < b.l;
  }
};
int t, n;
int a[N], b[N];
int l[N], r[N];
set<node> s;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    s.clear();
    for (int i = 1; i <= n; i++) cin >> a[i], l[i] = r[i] = i, b[a[i]] = i;
    if (n == 1) {
      cout << "Yes" << endl;
      continue;
    }
    bool f = true;
    for (int i = 1; i <= n; i++) {
      int maxi, maxj = 1;
      auto it = s.end();
      if (s.size() == 0)
        maxi = 1;
      else {
        it--;
        if (it->r == n) {
          if (s.size() == 1)
            maxi = 1;
          else
            it--, maxi = it->r - it->l + 2;
        } else
          maxi = it->r - it->l + 2;
      }
      if (s.count({l[b[i] - 1], r[b[i] - 1]}))
        maxj = r[b[i] - 1] - l[b[i] - 1] + 2;
      if (maxi != maxj) {
        f = false;
        cout << "No" << endl;
        break;
      }
      int li = 0, ri = 0;
      if (s.count({l[b[i] - 1], r[b[i] - 1]})) {
        s.erase({l[b[i] - 1], r[b[i] - 1]});
        li = 1;
      }
      if (s.count({l[b[i] + 1], r[b[i] + 1]})) {
        s.erase({l[b[i] + 1], r[b[i] + 1]});
        ri = 1;
      }
      if (li && ri) {
        l[r[b[i] + 1]] = l[b[i] - 1];
        r[l[b[i] - 1]] = r[b[i] + 1];
        s.insert({l[b[i] - 1], r[b[i] + 1]});
      } else if (li) {
        l[b[i]] = l[b[i] - 1];
        r[l[b[i] - 1]] = b[i];
        s.insert({l[b[i] - 1], b[i]});
      } else if (ri) {
        r[b[i]] = r[b[i] + 1];
        l[r[b[i] + 1]] = b[i];
        s.insert({b[i], r[b[i] + 1]});
      } else
        s.insert({b[i], b[i]});
    }
    if (f) cout << "Yes" << endl;
  }
  return 0;
}
