#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, res = 0;
    cin >> n;
    vector<int> ar(n);
    for (int i = 0; i < n; i++) {
      cin >> ar[i];
      if (i && ar[i] - ar[i - 1] > 1) res = -1;
    }
    if (res == -1)
      cout << "NO";
    else
      cout << "YES";
    cout << endl;
  }
  return 0;
}
