#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
long long a[MAXN];
struct stru {
  int x, index;
};
vector<struct stru> v;
bool compare(struct stru X, struct stru Y) { return X.x < Y.x; }
void solve() {
  v.clear();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int tmp;
    struct stru tmp1;
    cin >> tmp;
    tmp1.x = tmp;
    tmp1.index = i + 1;
    v.push_back(tmp1);
  }
  sort(v.begin(), v.end(), compare);
  int INDEX = n;
  int tmp11, length = 1;
  for (int i = 0; i < n; i++) {
    if (v[i].index == INDEX) {
      INDEX -= length;
      length = 1;
      continue;
    } else {
      if (v[i].index - v[i + 1].index != -1) {
        cout << "NO" << endl;
        return;
      }
      length++;
    }
  }
  cout << "YES" << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
