#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long;
int main() {
  cout.precision(20);
  ios_base::sync_with_stdio(false);
  int cntTest;
  cin >> cntTest;
  for (int test = 0; test < cntTest; test++) {
    int n;
    cin >> n;
    vector<int> v(n);
    map<int, int> d;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      d[v[i]] = i;
    }
    vector<int> used(n);
    bool flag = true;
    for (int i = 1; i <= n; i++) {
      int pos = d[i];
      while (pos < n && !used[pos]) {
        used[pos] = 1;
        if (v[pos] != i) {
          flag = false;
          break;
        }
        i++;
        pos++;
      }
      if (!flag) {
        break;
      }
      i--;
    }
    cout << (flag ? "Yes\n" : "No\n");
  }
}
