#include <bits/stdc++.h>
int main() {
  int q;
  std::cin >> q;
  while (q--) {
    int n, i, *arr, *ans, l;
    std::cin >> n;
    arr = new int[n];
    ans = new int[n];
    for (i = 0; i < n; i++) {
      std::cin >> arr[i];
      ans[arr[i] - 1] = i;
    }
    bool b = true;
    bool* rep = new bool[n]{};
    rep[ans[0]] = true;
    l = (rep[ans[0]] ? n - 1 : n);
    for (i = 1; i < n; i++) {
      if (ans[i] != ans[i - 1] + 1 && ans[i - 1] < l) {
        b = false;
        break;
      }
      rep[ans[i]] = true;
      while (l > 0 && rep[l - 1]) --l;
    }
    std::cout << (b ? "Yes\n" : "No\n");
  }
  return 0;
}
