#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> arr(n, 0);
    vector<int> mp(n, 0);
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      arr[i]--;
      mp[arr[i]] = i;
    }
    int start = 0;
    int i = 0;
    vector<int> vis(n, 0);
    int flag = 0;
    while (i < n) {
      int pos = mp[i];
      if (vis[pos] == 1) {
        i++;
        continue;
      }
      vis[pos] = 1;
      for (int j = pos + 1; j < n && vis[j] == 0; j++) {
        if (arr[j] != arr[j - 1] + 1)
          flag = 1;
        else
          vis[j] = 1;
      }
      i++;
    }
    if (flag)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
