#include <bits/stdc++.h>
using namespace std;
vector<tuple<long long int, long long int, long long int> > v;
vector<long long int> v1, v3;
vector<pair<char, long long int> > v2;
long long int i, j, k, n, sum = 0, p, r, ct = 0, q, sum1 = 0, sum2, t;
set<long long int> s, s1;
priority_queue<long long int> g;
const int maxn = 1e3 + 100, inf = 1e9 + 100;
long long int dp[maxn][3];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> t;
  while (t--) {
    q = 0;
    cin >> n;
    long long int a[n];
    map<long long int, long long int> m, m1;
    for (i = 1; i < n + 1; i++) {
      cin >> a[i];
      m[a[i]] = i;
    }
    p = m[1];
    for (i = 1; i < n + 1; i++) {
      if (m[i] != p) {
        q = 1;
        break;
      } else {
        a[m[i]] = -1;
      }
      if (m[i] == n && i < n)
        p = m[i + 1];
      else if (m[i] < n && a[m[i] + 1] != -1)
        p++;
      else if (m[i] < n && a[m[i] + 1] == -1)
        p = m[i + 1];
    }
    if (q != 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
