#include <bits/stdc++.h>
using namespace std;
long long test, n, res = 0, ans;
pair<int, int> p[200001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> test;
  while (test--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      p[i].second = i;
      cin >> p[i].first;
    }
    sort(p + 1, p + 1 + n);
    stack<int> qu;
    qu.push(0);
    int mx = n, check = 0;
    for (int i = 1; i <= n; i++) {
      int u = qu.top();
      int x = p[i].second;
      if (u == mx) {
        while (mx == qu.top()) {
          mx--;
          qu.pop();
        }
      }
      u = qu.top();
      if (x == u + 1 || u == 0) {
        qu.push(x);
      } else {
        cout << "No" << endl;
        check = 1;
        break;
      }
    }
    if (!check) cout << "Yes" << endl;
  }
}
