#include <bits/stdc++.h>
using namespace std;
const int N = 3 * 1e5 + 100;
int t, n, a[N];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    bool bl = 1;
    vector<int> p;
    int l, r;
    l = 0;
    r = (int)1e9;
    for (int i = 1; i <= n; i++) {
      if (a[i] < i - 1 && a[i] >= n - i) r = min(r, i);
      if (a[i] >= i - 1 && a[i] < n - i) l = max(l, i);
      if (a[i] >= i - 1 && a[i] >= n - i) p.push_back(i);
      if (a[i] < i - 1 && a[i] < n - i) {
        bl = 0;
        break;
      }
    }
    if (!bl) {
      printf("No\n");
      continue;
    }
    for (int i = 0; i < (int)p.size(); i++) {
      if (r > p[i] && l < p[i]) {
        bl = 0;
        break;
      }
    }
    if (bl)
      printf("No\n");
    else
      printf("Yes\n");
  }
}
