#include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   long long ksm(long long a, long long b) {     long long res = 1;     a %= mod;     assert(b >= 0);     for (; b; b >>= 1) {       if (b & 1) res = res * a % mod;       a = a * a % mod;     }     return res;   }   long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }   const int N = 1e5;   int n, t, p[N], pos[N], tmp[N];   int main() {     scanf( %d , &t);     while (t--) {       scanf( %d , &n);       for (int i = 1; i <= n; i++) {         scanf( %d , &p[i]);         tmp[i] = 0;         pos[p[i]] = i;       }       bool f = false;       for (int i = 1; i <= n; i++) {         if (tmp[pos[i]]) {           continue;         } else {           tmp[pos[i]] = i;           int x = i + 1;           for (int j = pos[i] + 1, x = i + 1; j <= n; j++) {             if (tmp[j]) break;             tmp[j] = x++;           }           i = x - 1;         }       }       for (int i = 1; i <= n; i++) {         if (p[i] == tmp[i]) continue;         f = true;         break;       }       if (f)         puts( NO );       else         puts( YES );     }     return 0;   }   