#include <bits/stdc++.h>
using namespace std;
char _buf[100000], *_op(_buf), *_ed(_buf);
inline int getint() {
  int _s = 0, _f = 1;
  char _ch = (_op == _ed && (_ed = (_op = _buf) + fread(_buf, 1, 100000, stdin),
                             _op == _ed)
                  ? EOF
                  : *_op++);
  while (!('0' <= _ch && _ch <= '9'))
    (_ch == '-') && (_f = -1),
        _ch =
            (_op == _ed && (_ed = (_op = _buf) + fread(_buf, 1, 100000, stdin),
                            _op == _ed)
                 ? EOF
                 : *_op++);
  while (('0' <= _ch && _ch <= '9'))
    _s = _s * 10 + _ch - 48,
    _ch = (_op == _ed && (_ed = (_op = _buf) + fread(_buf, 1, 100000, stdin),
                          _op == _ed)
               ? EOF
               : *_op++);
  return _s * _f;
}
const int N = 2e5 + 2;
int T, n;
int a[N], fa[N], siz[N];
multiset<int> mp;
inline void input() {
  n = getint(), mp.clear();
  for (int i = 1; i <= n; i++) a[i] = getint();
}
inline int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
inline void init() {
  for (int i = 1; i <= n; i++) fa[i] = i, siz[i] = 1, mp.insert(1);
  fa[n + 1] = 0;
}
inline int top() { return *--mp.end(); }
inline void del(int x) { mp.erase(mp.find(x)); }
inline void work() {
  for (int i = 1; i <= n; i++)
    if (siz[a[i]] == top()) {
      int x = a[i], y = find(a[i] + 1);
      del(siz[x]);
      if (y) del(siz[y]), siz[y] += siz[x], mp.insert(siz[y]);
      fa[x] = y;
    } else
      return void(cout << "No\n");
  cout << "Yes\n";
}
int main() {
  for (scanf("%d", &T); T--;) {
    input();
    init();
    work();
  }
  return 0;
}
