#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    long long a[n + 1];
    for (int i = 1; i <= n; i++) cin >> a[i];
    int t[n + 1];
    for (int i = 0; i < n + 1; i++) {
      t[i] = 0;
    }
    for (int i = 1; i <= n; i++) {
      t[a[i]] = i;
    }
    int test = 0;
    for (int i = 1; i < n; i++) {
      if (t[i] != n && (a[t[i]] + 1 < a[t[i] + 1])) {
        test = 1;
        break;
      }
    }
    (test) ? cout << "NO\n" : cout << "YES\n";
  }
  return 0;
}
