#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v(n + 1);
    vector<long long> ind(n + 1);
    vector<long long> cnt(n + 1, 0);
    for (long long i = 1; i <= n; i++) {
      cin >> v[i];
      ind[v[i]] = i;
    }
    long long f = 1;
    for (long long i = 1; i <= n;) {
      long long j = ind[i];
      while (i <= n && j <= n && cnt[j] == 0) {
        if (j != ind[i]) {
          f = 0;
          break;
        }
        cnt[j] = 1;
        j++;
        if (i <= n)
          i++;
        else
          break;
      }
      if (f == 0) break;
    }
    if (f)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
