#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
const int mod = 1e9 + 7;
void hey() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int pos[N];
int a[N];
int was[N];
int main() {
  hey();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
    }
    bool ans = 0;
    for (int i = 1; i <= n;) {
      for (int j = pos[i]; j <= n && i <= n && !was[j];) {
        if (a[j] == i) {
          was[j] = 1;
          i++;
          j++;
        } else {
          ans = 1;
          cout << "NO\n";
          break;
        }
      }
      if (ans) {
        break;
      }
    }
    for (int i = 1; i <= n; i++) {
      was[i] = 0;
    }
    if (!ans) {
      cout << "YES\n";
    }
  }
}
