#include <bits/stdc++.h>
using namespace std;
int m[200002];
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  long long int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; (i) < (n); ++(i)) cin >> m[i];
    int m_i = 0;
    int flag = 0;
    for (int i = (1); (i) < (n); ++(i)) {
      if (m[i] < m[i - 1]) {
        if (m[i] > m[m_i]) {
          flag = 1;
          break;
        }
        m_i = i;
      } else if (m[i] != m[i - 1] + 1) {
        flag = 1;
        break;
      }
    }
    if (flag)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
