#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 100;
int a[N];
int main(void) {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    int toR = 0;
    int toL = n - 1;
    for (int i = 0; i < n; i++) {
      if (a[i] >= i)
        toR = i;
      else
        break;
    }
    for (int i = n - 1; i >= 0; i--) {
      if (a[i] >= (n - 1 - i))
        toL = i;
      else
        break;
    }
    if (toL - toR == 1 && a[toL] == a[toR])
      puts("NO");
    else if (toL - toR > 1)
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
