#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    long long int hesh[n + 1];
    for (long long int i = 0; i < n; i++) {
      cin >> arr[i];
      hesh[arr[i]] = i;
    }
    long long int i = hesh[1];
    bool ans = true;
    while (1) {
      long long int j = i;
      while ((j + 1) < n && arr[j + 1] == (arr[j] + 1)) {
        j++;
      }
      if ((j + 1) == n || (arr[j + 1] < arr[j])) {
        if (arr[j] == n)
          break;
        else
          i = hesh[arr[j] + 1];
      } else if (arr[j + 1] > (arr[j] + 1)) {
        ans = false;
        break;
      }
    }
    if (ans)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
