#include <bits/stdc++.h>
using namespace std;
template <typename T>
void setmax(T& x, T y) {
  x = max(x, y);
}
template <typename T>
void setmin(T& x, T y) {
  x = min(x, y);
}
const double PI = acos(-1.0);
const long long INF = 1e9 + 47;
const long long LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = (0); i < (n); ++i) cin >> a[i], a[i]--;
    vector<int> pos(n);
    for (int i = (0); i < (n); ++i) pos[a[i]] = i;
    bool ok = true;
    int lst = 0;
    while ((int)((a).size())) {
      int p = pos[lst];
      for (int i = (p); i < ((int)((a).size()) - 1); ++i)
        ok &= a[i] + 1 == a[i + 1];
      if (!ok) break;
      lst += (int)((a).size()) - p;
      a.resize(p);
    }
    cout << (ok ? "Yes\n" : "No\n");
  }
  cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
  return 0;
}
