#include <bits/stdc++.h>
using namespace std;
int t, tt, i, j, n, m, a[100001], mm, nn, ls, ls1;
bool pn[100001];
bool ans;
vector<int> aa;
int main() {
  scanf("%d", &t);
  for (tt = 1; tt <= t; tt++) {
    scanf("%d", &n);
    for (i = 1; i <= n; i++) scanf("%d", &a[i]);
    ans = true;
    ls = n + 1;
    ls1 = a[1];
    for (i = 1; i < n; i++) {
      if (a[i] > a[i + 1]) {
        if (ls != a[i] + 1) {
          ans = false;
          break;
        } else {
          ls = ls1;
          ls1 = a[i + 1];
        }
      } else if (a[i] != a[i + 1] - 1) {
        ans = false;
        break;
      }
    }
    if (ans)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
