#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, N = 5e5 + 10;
const double PI = acos(-1);
const long long LINF = LLONG_MAX;
vector<long long> q(N);
bool check(long long pos) {
  if (pos == 0) {
    return 1;
  }
  long long id;
  for (long long i = 1; i < pos + 1; i++) {
    if (q[i] == 1) {
      id = i;
      break;
    }
  }
  for (long long i = id; i < pos + 1; i++) {
    if (q[i] != i - id + 1) {
      return false;
    }
  }
  for (long long i = 1; i < id; i++) {
    q[i] = q[i] - (pos - id + 1);
  }
  return check(id - 1);
}
void test() {
  long long n;
  cin >> n;
  for (long long i = 1; i < n + 1; i++) {
    cin >> q[i];
  }
  if (check(n)) {
    cout << "YES\n";
  } else
    cout << "NO\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long tt = 1;
  cin >> tt;
  for (long long i = 0; i < tt; i++) test();
  return 0;
}
