#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n + 1];
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    int i;
    int j = 0;
    for (i = n; i >= 1; i--) {
      if (a[i] >= j)
        j++;
      else
        break;
    }
    int flag = 0;
    for (int k = i; k >= 1; k--) {
      if (k == i && i < n) {
        if (n - j - 1 >= a[i + 1]) break;
      }
      if (a[k] >= n - j - 1)
        j++;
      else
        break;
    }
    if (j >= n)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
