#include <bits/stdc++.h>
using namespace std;
long long bigmod(long long b, long long p, long long md) {
  if (p == 0) return 1;
  if (p % 2 == 1) {
    return ((b % md) * bigmod(b, p - 1, md)) % md;
  } else {
    long long y = bigmod(b, p / 2, md);
    return (y * y) % md;
  }
}
bool vis[1000002];
bool tourist[1000002];
long long maxtouristtillthenode[1000002];
long long parent[1000002];
vector<long long> adj[1000002];
vector<pair<long long, long long> > degree(1000002);
vector<long long> d(1000002);
void dfs(long long u) {
  vis[u] = true;
  for (auto i : adj[u])
    if (!vis[i]) dfs(i);
}
bool cmp(int u, int v) { return u > v; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    map<int, int> idx;
    for (int i = 0; i < n; i++) cin >> v[i], idx[v[i]] = i;
    int num = 1;
    bool flag = true;
    int wall = n;
    while (num <= n) {
      int temp = idx[num];
      int cnt = temp;
      while (cnt < wall) {
        if (v[cnt] != num) {
          flag = false;
          break;
        }
        num++;
        cnt++;
      }
      if (!flag) {
        break;
      }
      wall = temp;
    }
    flag ? cout << "Yes" << endl : cout << "No" << endl;
  }
  return 0;
}
