#include <bits/stdc++.h>
using namespace std;
long long xx, fr[300009];
struct st {
  long long id1, id2;
} str[300009];
long long bgmod(long long v1, long long v2, long long md) {
  long long res = 1;
  v1 = v1 % md;
  while (v2 > 0) {
    if (v2 & 1) res = (res * v1) % md;
    v2 = v2 >> 1;
    v1 = (v1 * v1) % md;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, a, b, c;
    vector<long long> vec;
    cin >> n;
    map<long long, long long> mp;
    for (long long i = 1; i <= n; i++) {
      cin >> fr[i];
      mp[fr[i]] = i;
    }
    long long base = n, ok = -1;
    bool f = true;
    for (long long i = 2; i <= n; i++) {
      long long dif = mp[i] - mp[i - 1];
      if (dif > 1) {
        f = false;
        break;
      }
    }
    if (f == true)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
