#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e5 + 10;
const long long inf = 1e18 + 100;
const long long mod = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  vector<long long> arr(n + 1, 0), sol(n + 1, 0), brr(n + 1);
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    brr[i + 1] = x;
    arr[x] = i + 1;
  }
  for (int i = 1; i <= n;) {
    long long pos = arr[i];
    if (sol[pos]) {
      cout << "NO\n";
      return;
    }
    while (pos <= n && i <= n && sol[pos] == 0) {
      sol[pos] = i;
      pos++;
      i++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (sol[i] != brr[i]) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
