#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18 + 1;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  ll t;
  cin >> t;
  while (t--) {
    ll n;
    cin >> n;
    vector<ll> vec(n);
    for (ll i = 0; i < n; ++i) {
      cin >> vec[i];
    }
    bool is_possible = true;
    for (ll i = 1; i < n; ++i) {
      if (vec[i] > vec[i - 1] && vec[i] - vec[i - 1] != 1) {
        is_possible = false;
        break;
      }
    }
    if (is_possible) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
