#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void __print(long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  long long f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
vector<long long> positions;
bool rec(vector<long long> &a, long long f, long long l, long long val) {
  ;
  if (f >= l) {
    return true;
  }
  long long start = positions[val];
  long long cnt = 1;
  for (long long i = start; i < l; i++) {
    if (a[i + 1] - a[i] == 1) {
      cnt++;
      continue;
    } else {
      return false;
    }
  }
  return rec(a, f, start - 1, val + cnt);
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  positions.assign(n, 0);
  for (long long i = 0; i < (n); i++) {
    cin >> a[i];
    positions[--a[i]] = i;
  };
  if (rec(a, 0, n - 1, 0)) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  positions.clear();
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
