#include <bits/stdc++.h>
using namespace std;
void yash() {
  long long n;
  cin >> n;
  long long arr[n + 1];
  for (long long i = 1; i <= n; i++) cin >> arr[i];
  if (n == 1) {
    cout << "YES" << endl;
    return;
  }
  long long pos[n + 1], vis[n + 1];
  for (long long i = 1; i <= n; i++) {
    pos[arr[i]] = i;
    vis[i] = 0;
  }
  vis[0] = 0;
  vis[pos[1]] = 1;
  for (long long i = 2; i <= n; i++) {
    if (pos[i - 1] + 1 > n) {
      vis[pos[i]] = 1;
    } else {
      if (pos[i - 1] + 1 != pos[i] && vis[pos[i - 1] + 1] == 0) {
        cout << "NO" << endl;
        return;
      } else {
        vis[pos[i]] = 1;
      }
    }
  }
  cout << "YES" << endl;
  return;
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) yash();
  return 0;
}
