#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    map<int, int> m;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      m[v[i]] = i;
    }
    int count = 1, end = n;
    bool flag = true;
    while (count < n && flag) {
      int start = m[count];
      for (int i = start; i < end; i++) {
        if (v[i] != count) {
          flag = false;
          break;
        } else
          count++;
      }
      end = start;
    }
    if (flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
