#include <bits/stdc++.h>
using namespace std;
ostream &operator<<(ostream &out, string str) {
  for (char c : str) out << c;
  return out;
}
template <class L, class R>
ostream &operator<<(ostream &out, pair<L, R> p) {
  return out << "(" << p.first << ", " << p.second << ")";
}
template <class T>
auto operator<<(ostream &out, T a) -> decltype(a.begin(), out) {
  out << "{";
  for (auto it = a.begin(); it != a.end(); it = next(it))
    out << (it != a.begin() ? ", " : "") << *it;
  return out << "}";
}
void dump() { cerr << "\n"; }
template <class T, class... Ts>
void dump(T a, Ts... x) {
  cerr << a << ", ";
  dump(x...);
}
template <class T>
int size(T &&a) {
  return (int)a.size();
}
using LL = long long;
using PII = pair<int, int>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (int _t = 0; _t < t; _t++) {
    int n;
    cin >> n;
    vector<int> a(n), w(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      w[a[i] - 1] = i;
    }
    bool ok = true;
    int q = n;
    for (int i = 1; i <= n - 1; i++) {
      if (w[i - 1] + 1 != w[i]) {
        if (w[i - 1] + 1 != q) {
          ok = false;
          break;
        } else
          q = n - i;
      }
    }
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
