#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  for (int Ti = 0; Ti < T; ++Ti) {
    int n;
    cin >> n;
    int p[n];
    for (int i = 0; i < n; ++i) {
      cin >> p[i];
    }
    bool f = 1;
    int ls = -1, cs = p[0];
    for (int i = 1; i < n; ++i) {
      if (p[i] != p[i - 1] + 1) {
        if (ls != -1 && p[i - 1] + 1 != ls) f = 0;
        ls = cs;
        cs = p[i];
      }
    }
    if (ls != -1 && p[n - 1] + 1 != ls) f = 0;
    if (f)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
