#include <bits/stdc++.h>
using namespace std;
string to_string(string s) { return '"' + s + '"'; }
string to_string(char c) {
  string s = "'";
  s += c;
  return s + "'";
}
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) res += ", ";
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
istream_iterator<string> eos;
void dbg_out(istream_iterator<string> it) { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(istream_iterator<string> it, Head H, Tail... T) {
  cerr << *it << " = " << to_string(H);
  if (++it != eos) cerr << ", ";
  dbg_out(it, T...);
}
pair<long long, long long> dir[8] = {{-1, 0}, {1, 0},   {0, -1}, {0, 1},
                                     {1, 1},  {-1, -1}, {-1, 1}, {1, -1}};
const long long inf = (1LL << 60), mod = 1e9 + 7, nn = 2e5 + 5;
void solve() {
  long long n;
  cin >> n;
  long long a[n + 1], pos[n + 1];
  for (long long i = 1; i < n + 1; i++) {
    cin >> a[i];
    pos[a[i]] = i;
  }
  vector<bool> occ(n + 1, 0);
  long long next = -1;
  for (long long i = 1; i <= n; i++) {
    long long x = pos[i];
    if (next == -1) {
      next = x + 1;
      if (next > n || occ[next]) next = -1;
      occ[x] = 1;
    } else {
      if (x == next) {
        next++;
        if (next > n || occ[next]) next = -1;
        occ[x] = 1;
      } else {
        cout << "No\n";
        return;
      }
    }
  }
  cout << "Yes\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long T = 1;
  cin >> T;
  for (long long tc = 1; tc <= T; tc++) {
    solve();
  }
  return 0;
}
