#include <bits/stdc++.h>
int main() {
  int T;
  std::cin >> T;
  std::vector<int> p;
  while (T--) {
    [&]() {
      p.clear();
      int n;
      std::cin >> n;
      for (int i = 0; i < n; i++) {
        int a;
        std::cin >> a;
        p.push_back(a);
      }
      int curmax = n;
      int pos = 0;
      while (pos < n) {
        if (curmax == p[pos]) {
          curmax = p[pos] - 1;
          pos++;
          continue;
        }
        int prev = pos;
        for (int i = p[pos]; i < curmax; i++, pos++) {
          if (p[pos] + 1 != p[pos + 1]) {
            std::cout << "No\n";
            return;
          }
        }
        pos++;
        curmax = p[prev] - 1;
      }
      std::cout << "Yes\n";
    }();
  }
  return 0;
}
