#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (; t > 0; t--) {
    int n, i, x;
    cin >> n;
    int arr[n + 1];
    for (i = 1; i <= n; i++) {
      cin >> x;
      arr[x] = i;
    }
    int mi = arr[1], f = 0, ma = arr[1];
    for (i = 2; i <= n; i++) {
      if (mi == n - i + 2 && ma == n) {
        mi = min(mi, arr[i]);
        ma = max(ma, arr[i]);
      } else {
        if (arr[i] != arr[i - 1] + 1) {
          f = 1;
          break;
        }
        mi = min(mi, arr[i]);
        ma = max(ma, arr[i]);
      }
    }
    if (f == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
