#include <bits/stdc++.h>
using namespace std;
long long be(long long a, long long b, long long mod) {
  if (b == 0) return 1;
  if (b % 2 == 1)
    return (a * be(a, b - 1, mod)) % mod;
  else
    return (be(a, b / 2, mod) * be(a, b / 2, mod)) % mod;
}
const long long mod = 1e10 + 7;
const long long siz = 2 * (1e6 + 1);
const long long logi = 21;
const double epsilon = 1e-6;
long long prime[siz];
bool cmp(const long long &a, const long long &b) { return (abs(a - b) > 1); }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    map<long long, long long> mp;
    long long has[n];
    set<long long> st;
    memset(has, 0, sizeof(has));
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      st.insert(a[i]);
      mp[a[i]] = i;
    }
    long long flag = 0;
    while (st.size() > 0) {
      auto it = st.begin();
      long long spos = mp[*it];
      if (flag == 1) {
        break;
      }
      while (has[spos] != 1) {
        has[spos] = 1;
        auto it1 = st.begin();
        if (a[spos] != *it1) {
          flag = 1;
          break;
        }
        st.erase(a[spos]);
        spos++;
        if (spos >= n) {
          break;
        }
      }
    }
    if (flag == 0) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
}
