#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> p(n, 0);
    for (long long i = 0; i < n; ++i) {
      cin >> p[i];
    }
    vector<long long> v;
    v = p;
    reverse(v.begin(), v.end());
    long long l = 0;
    long long m = p[0];
    bool flag = true;
    for (long long i = 0; i < n - 1; i++) {
      if (p[i] != p[i + 1] - 1 && p[i + 1] > m) {
        flag = false;
      } else {
        m = min(m, p[i + 1]);
      }
    }
    if (flag) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
