#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int MOD = 1000000007;
const int inf = (1 << 30) - 1;
const ll INF = (1LL << 60) - 1;
template <typename T>
bool chmax(T &x, const T &y) {
  return (x < y) ? (x = y, true) : false;
};
template <typename T>
bool chmin(T &x, const T &y) {
  return (x > y) ? (x = y, true) : false;
};
struct io_setup {
  io_setup() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed << setprecision(15);
  }
} io_setup;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int N;
    cin >> N;
    vector<int> p(N);
    for (int i = 0; i < N; i++) {
      cin >> p[i];
      p[i]--;
    }
    vector<int> id(N);
    for (int i = 0; i < N; i++) id[p[i]] = i;
    bool flag = false;
    for (int i = 0; i < N;) {
      int p = id[i], j = 0;
      while (id[i + j] == id[i] + j) j++;
      i += j;
      if (i != N - p) {
        cout << "No\n";
        flag = true;
        break;
      }
    }
    if (!flag) cout << "Yes\n";
  }
}
