#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long mas[N];
long long pos[N];
void solve() {
  long long n;
  cin >> n;
  for (long long i = (long long)0; i < (long long)n; i++) {
    long long a;
    cin >> a;
    mas[i] = a;
    pos[a] = i;
  }
  long long cur = 1;
  long long len = n;
  long long left = pos[cur];
  while (cur != n) {
    long long curPos = pos[cur];
    long long nextPos = pos[cur + 1];
    if (curPos == len - 1) {
      cur++;
      len = left;
      left = nextPos;
    } else if (curPos + 1 == nextPos) {
      cur++;
    } else {
      cout << "NO";
      return;
    }
  }
  cout << "Yes";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tests = 1;
  cin >> tests;
  while (tests--) {
    solve();
    cout << "\n";
  }
  return 0;
}
