#include <bits/stdc++.h>
using namespace std;
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2>& p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int p[n + 1];
    unordered_map<int, int> umap;
    for (int i = 0; i < n; i++) {
      cin >> p[i + 1];
      umap[p[i + 1]] = i + 1;
    }
    int x = 0;
    int y = n;
    for (int i = 1; i <= n; i++) {
      for (int j = umap[i]; j <= y; j++) {
        if (p[j] != i + j - umap[i]) {
          x = 1;
          break;
        }
      }
      if (x == 1)
        break;
      else {
        int k = i;
        i = p[y];
        y = umap[k] - 1;
      }
    }
    if (x == 1)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
}
