#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline bool chmax(A &a, B b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename A, typename B>
inline bool chmin(A &a, B b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll << 30;
constexpr ll longINF = 1ll << 60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
void solve() {
  int n;
  scanf("%d", &n);
  std::vector<int> p(n);
  for (int i = (0); i < (n); ++i) scanf("%d", &p[i]), --p[i];
  vector<int> idx(n);
  for (int i = (0); i < (n); ++i) idx[p[i]] = i;
  bool ans = true;
  int cur = 0;
  stack<int> stk;
  stk.push(p[0]);
  for (int i = (0); i < (n - 1); ++i)
    if (p[i] > p[i + 1]) stk.push(p[i + 1]);
  int last = n;
  int mx = -1;
  while (!stk.empty()) {
    int st = stk.top();
    stk.pop();
    ans &= mx < st;
    int i = idx[st];
    for (int j = i; j < last; ++j) {
      ans &= p[j] - p[i] == j - i;
      chmax(mx, p[j]);
    }
    last = i;
  }
  puts([&] { return ans; }() ? "Yes" : "No");
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
