#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int m_inf = INT_MIN;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n + 1];
    long long int pos[n + 1];
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
    }
    long long int flag = 0;
    for (long long int i = 2; i <= n; i++) {
      if (pos[i] == pos[i - 1] + 1 || pos[i] < pos[i - 1])
        continue;
      else {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
