#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[";
  for (int i = 0; i < (((int)(v).size())); ++i) {
    if (i) os << ", ";
    os << v[i];
  }
  return os << "]";
}
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  return os << "(" << p.first << " " << p.second << ")";
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
const ll MOD = 1e9 + 7;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
const ld eps = 1e-9;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vi a(n);
    for (int i = 0; i < (n); ++i) cin >> a[i];
    int prv = a[0];
    vector<P> ps;
    bool valid = true;
    for (int i = 0; i < (n - 1); ++i) {
      if (a[i] + 1 == a[i + 1]) {
        continue;
      } else if (a[i] > a[i + 1]) {
        ps.emplace_back(prv, a[i]);
        prv = a[i + 1];
      } else {
        valid = false;
        break;
      }
    }
    if (!valid) {
      cout << "No" << endl;
      continue;
    }
    for (int i = 0; i < (((int)(ps).size()) - 1); ++i) {
      if (ps[i].first != ps[i + 1].second + 1) {
        valid = false;
        break;
      }
    }
    if (!valid) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
