#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    int n, a;
    cin >> n;
    vector<int> pos(n + 1), p(n + 2);
    p[n + 1] = -1;
    for (int i = 1; i <= n; i++) {
      cin >> a;
      pos[a] = i;
    }
    int cur = -1;
    bool flag = true;
    for (int i = 1; i <= n; i++) {
      int wh = pos[i];
      if (cur == -1) {
        p[wh] = i;
        if (p[wh + 1] == 0)
          cur = wh + 1;
        else
          cur = -1;
      } else {
        if (wh != cur) {
          flag = false;
          break;
        } else {
          p[wh] = cur;
          if (p[wh + 1] == 0)
            cur = wh + 1;
          else
            cur = -1;
        }
      }
    }
    if (flag)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
