#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a;
    cin >> n;
    map<int, int> mp;
    set<int> s;
    set<int>::reverse_iterator rit;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a);
      mp[a] = i;
      s.insert(i);
    }
    int k = n;
    bool ans = true;
    for (int i = 1; i <= n; i++) {
      if (i == 1 || mp[i] - mp[i - 1] == 1 || mp[i - 1] == k) {
        rit = s.rbegin();
        k = *rit;
        s.erase(mp[i]);
      } else {
        ans = false;
        break;
      }
    }
    if (ans == false)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
