#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int flag = 1;
    int ind[n + 1], a[n + 1];
    for (int i = 1; i < n + 1; i++) {
      cin >> a[i];
      ind[a[i]] = i;
    }
    if (n < 3) {
      cout << "Yes\n";
      continue;
    }
    int b[n + 1];
    memset(b, -1, sizeof(b));
    b[ind[1]] = 1;
    int c = 2, i = ind[1] + 1;
    while (c <= n) {
      while (c <= n && i <= n && b[i] == -1) {
        b[i] = c;
        c++;
        i++;
      }
      if (c > n) break;
      if (b[ind[c]] != -1) {
        flag = 0;
        break;
      }
      i = ind[c];
    }
    if (!flag) {
      cout << "No\n";
      continue;
    }
    for (int i = 1; i <= n; i++) {
      if (b[i] != a[i]) {
        flag = 0;
        break;
      }
    }
    if (flag)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
