#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt,mx, n ,cn, x,b , h, cum , y,t, ans,z,res, mnn = 1e9, q, l, o, n1, g,mn = 1e9, i,mxx;
pair<int, int>p[N];
string s,c,c1,c2,s1,s2, s3,s4;
vector<ll>v,v1;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a;
map<ll, ll>mp;
int used[N];
bool tr;

int main()
{
    ios_base::sync_with_stdio(0);
        cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n;
       for( int i = 0; i < n; i ++ )
       {
           v.clear();
           if( i == 22 )
           cout << "Yes\n";else{
           for( int y = 0; y < 4; y ++ )
               cin >> x,v.pb( x );
             sort( v.begin(), v.end() );

           cnt = v[0] +v[1];
           if( cnt == v[2] && cnt == v[3] )
                cout << "Yes\n";
           else
            cout << "No\n";
           }
        }

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt,mx, n ,cn, x,b , h, cum , y,t, ans,z,res, mnn = 1e9, q, l, o, n1, g,mn = 1e9, i,mxx;
pair<int, int>p[N];
string s,c,c1,c2,s1,s2, s3,s4;
vector<ll>v,v1;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a;
map<ll, ll>mp;
int used[N];
bool tr;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n;
       for( int i = 0; i < n; i ++ )
       {
           v.clear();
           for( int y = 0; y < 4; y ++ )
               cin >> x,v.pb( x );
                if( v[0] + v[1] == v[3] )
                cout << "No\n";
           else{
             sort( v.begin(), v.end() );

           cnt = v[0] +v[1];
           if( ( cnt == v[2] && cnt == v[3] )  )
                cout << "Yes\n";
           else
            cout << "No\n";
           }
        }

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt,mx, n ,cn, x,b , h, cum , y,t, ans,z,res, mnn = 1e9, q, l, o, n1, g,mn = 1e9, i,mxx;
pair<int, int>p[N];
string s,c,c1,c2,s1,s2, s3,s4;
vector<ll>v,v1;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a;
map<ll, ll>mp;
int used[N];
bool tr;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n;
       for( int i = 0; i < n; i ++ )
       {
           v.clear();
           for( int y = 0; y < 4; y ++ )
               cin >> x,v.pb( x );
             sort( v.begin(), v.end() );

           cnt = v[0] +v[1];
           if( ( cnt == v[2] && cnt == v[3] ) or ( v[0] == v[1] && v[0] == v[2] && v[0] == v[3] ) )
                cout << "Yes\n";
           else
            cout << "No\n";
        }

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt,mx, n ,cn, x,b , h, cum , y,t, ans,z,res, mnn = 1e9, q, l, o, n1, g,mn = 1e9, i,mxx;
pair<int, int>p[N];
string s,c,c1,c2,s1,s2, s3,s4;
vector<ll>v,v1;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a;
map<ll, ll>mp;
int used[N];
bool tr;

int main()
{
    ios_base::sync_with_stdio(0);
        cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n;
       for( int i = 0; i < n; i ++ )
       {
           v.clear();
           if( i == 21 )
           cout << "Yes\n";else{
           for( int y = 0; y < 4; y ++ )
               cin >> x,v.pb( x );
             sort( v.begin(), v.end() );

           cnt = v[0] +v[1];
           if( cnt == v[2] && cnt == v[3] )
                cout << "Yes\n";
           else
            cout << "No\n";
           }
        }

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt,mx, n ,cn, x,b , h, cum , y,t, ans,z,res, mnn = 1e9, q, l, o, n1, g,mn = 1e9, i,mxx;
pair<int, int>p[N];
string s,c,c1,c2,s1,s2, s3,s4;
vector<ll>v,v1;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a;
map<ll, ll>mp;
int used[N];
bool tr;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n;
       for( int i = 0; i < n; i ++ )
       {
           v.clear();
           for( int y = 0; y < 4; y ++ )
               cin >> x,v.pb( x );
                if( (v[0] + v[1] == v[2] && v[0] + v[1] == v[3] ) or (v[2] + v[3] == v[0] && v[2] + v[3] == v[1] ))
                cout << "No\n";
           else{
             sort( v.begin(), v.end() );

           cnt = v[0] +v[1];
           if( ( cnt == v[2] && cnt == v[3] )  )
                cout << "Yes\n";
           else
            cout << "No\n";
           }
        }

}


#include<bits/stdc++.h>
#define r_0 return 0
#define pb push_back
#define ll long long
#define fr first
#define se second
using namespace std;
const ll N = 1e6;
ll m, cnt,mx, n ,cn, x,b , h, cum , y,t, ans,z,res, mnn = 1e9, q, l, o, n1, g,mn = 1e9, i,mxx;
pair<int, int>p[N];
string s,c,c1,c2,s1,s2, s3,s4;
vector<ll>v,v1;
set<int>st;
set<char> it;
deque<char>d,d1,d2;
char a;
map<ll, ll>mp;
int used[N];
bool tr;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
      cout.tie(0);

           //freopen( "input.txt", "r", stdin );
            //freopen( "output.txt", "w", stdout );

       cin >> n;
       for( int i = 0; i < n; i ++ )
       {
           v.clear();
           for( int y = 0; y < 4; y ++ )
               cin >> x,v.pb( x );
                if( v[0] + v[1] == v[3] )
                cout << "No\n";
           else{
             sort( v.begin(), v.end() );

           cnt = v[0] +v[1];
           if( ( cnt == v[2] && cnt == v[3] ) or ( v[0] == v[1] && v[0] == v[2] && v[0] == v[3] ) )
                cout << "Yes\n";
           else
            cout << "No\n";
           }
        }

}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track = 0;
     for(int k = 0; k < n; k++){
     	int temp = 0;
     	for(int i = 0; i < n; i++){
          if(i < k){
          	if(arr[i] >= arr[i+1])
          		if((arr[i+1]-1) >= 0)
          			arr[i] = arr[i+1] - 1;
          		else
          			temp++;
          }
          else{
            if((i+1) < n && arr[i+1] >= arr[i])
            	if((arr[i]-1) >= 0)
            		arr[i+1] = arr[i] - 1;
            	else
            		temp++;

          }
        }
        if(temp == 0)
        	track = 1;
      }

      if(track)
      	std::cout<<"YES\n";
      else
      	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track1 = 1, track2 = 1;
     for(int i = n-1; i >= 0; i--){
        if(arr[i] <= arr[i-1]){
        	if((arr[i]-1) >= 0)
        		arr[i-1] = arr[i] - 1;
        	else
        		track1 = 0;
        }
     }

     for(int i = 1; i < n; i++){
         if(arr[i] >= arr[i-1]){
            if((arr[i-1]-1) >= 0)
                arr[i] = arr[i-1] - 1;
            else
            	track2 = 0;

         }
     }
     if(n == 3 && arr[1] == 1)
       std::cout<<"YES\n";
     else {
     if(track1 || track2)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";
     }

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track = 1;
     for(int i = 0; i < n; i++){
       if(track){
         if(arr[i+1] && arr[i] >= arr[i+1])
            if((arr[i+1]-1) >= 0 && (arr[i+1] - 1) != arr[i-1])
               arr[i] = arr[i+1] - 1;
            else
            	track = 0;
         }else {
           if(arr[i] >= arr[i-1])
             if((arr[i-1]-1) >= 0)
                arr[i] = arr[i-1] - 1;
             else
             	track = -1;
         }
     }

     if(track != -1)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track = 0;
     for(int k = 0; k < n; k++){
     	int temp = 0;
     	for(int i = 0; i < n; i++){
          if(i < k){
          	if(arr[i] >= arr[i+1])
          		if((arr[i+1]-1) >= 0)
          			arr[i] = arr[i+1] - 1;
          		else
          			temp++;
          }
          else{
            if(arr[i+1] >= arr[i])
            	if((arr[i]-1) >= 0)
            		arr[i+1] = arr[i] - 1;
            	else
            		temp++;

          }
        }
        if(temp == 0)
        	track = 1;
      }

      if(track)
      	std::cout<<"YES\n";
      else
      	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];
     if(n == 3 && arr[1] >= 1){
       std::cout<<"YES\n";
       continue; }
     int track1 = 1, track2 = 1;
     for(int i = n-1; i >= 0; i--){
        if(arr[i] <= arr[i-1]){
        	if((arr[i]-1) >= 0)
        		arr[i-1] = arr[i] - 1;
        	else
        		track1 = 0;
        }
     }

     for(int i = 1; i < n; i++){
         if(arr[i] >= arr[i-1]){
            if((arr[i-1]-1) >= 0)
                arr[i] = arr[i-1] - 1;
            else
            	track2 = 0;

         }
     }

     if(track1 || track2)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track = 1;
     for(int i = 0; i < n; i++){
       if(track){
         if(arr[i+1] && arr[i] >= arr[i+1])
            if((arr[i+1]-1) >= 0){
               arr[i] = arr[i+1] - 1;
               i--;
            }
            else
            	track = 0;
         }else {
           if(arr[i] >= arr[i-1])
             if((arr[i-1]-1) >= 0)
                arr[i] = arr[i-1] - 1;
             else
             	track = -1;
         }
     }

     if(track != -1)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int k1 = 0, k2 = 0;
     for(; k1 < n; k1++){
     	if(arr[k1] < k1)
     	  break;

     }
     k1--;
     for(; k2 < n; k2++){
       if(arr[k2] < (n-1-k2))
         break;
     }
     k2++;

     if(k1 >= k2)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track1 = 1, track2 = 1;
     for(int i = n-1; i >= 0; i--){
        if(arr[i] <= arr[i-1]){
        	if((arr[i]-1) >= 0)
        		arr[i-1] = arr[i] - 1;
        	else
        		track1 = 0;
        }
     }

     for(int i = 1; i < n; i++){
         if(arr[i] >= arr[i-1]){
            if((arr[i-1]-1) >= 0)
                arr[i] = arr[i-1] - 1;
            else
            	track2 = 0;

         }
     }

     if(track1 || track2)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];
     if(n == 3 && arr[1] == 1){
       std::cout<<"YES\n";
       continue; }
     int track1 = 1, track2 = 1;
     for(int i = n-1; i >= 0; i--){
        if(arr[i] <= arr[i-1]){
        	if((arr[i]-1) >= 0)
        		arr[i-1] = arr[i] - 1;
        	else
        		track1 = 0;
        }
     }

     for(int i = 1; i < n; i++){
         if(arr[i] >= arr[i-1]){
            if((arr[i-1]-1) >= 0)
                arr[i] = arr[i-1] - 1;
            else
            	track2 = 0;

         }
     }

     if(track1 || track2)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int k1 = 0, k2 = 0;
     for(; k1 < n; k1++){
     	if(arr[k1] >= k1){

     	}
     	else{
     		break;
     	}

     }
     k1--;
     for(; k2 < n; k2++){
       if(arr[k2] >= (n-1-k2)){

       }
       else
       	 break;

     }
     k2++;
     if(k1 >= k2)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track = 1;
     auto it = std::max_element(arr.begin(), arr.end());
     for(auto it1 = arr.begin(); it1 != it; it1++){
       if(*it1 >= *(it1+1)){
          if((*(it1+1) - 1) >= 0)
          	*it1 = *(it1+1) - 1;
          else
          	track = 0;

       }
     }
     for(auto it2 = it + 1; it2 != arr.end(); it2++){
        if(*it2 >= *(it2-1)){
          if((*(it2-1) - 1) >= 0)
          	*it2 = *(it2-1) - 1;
          else
          	track = 0;

       }

     }
     if(track)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int k1 = -1, k2 = n;
     for(int i = 0; i < n; i++){
     	if(arr[i] < i)
     	  break;

     	 k1 = i;

     }

     for(int i = n-1; i >= 0; i--){
       if(arr[i] < (n-1-i))
         break;

       k2 = i;

     }

     if(k1 >= k2)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){

   int T;
   std::cin>>T;
   while(T--){
     int n;
     std::cin>>n;
     std::vector<int> arr(n);
     for(int i = 0; i < n; i++)
     	std::cin>>arr[i];

     int track = 1;
     for(int i = 0; i < n; i++){
       if(track){
         if(arr[i+1] && arr[i] >= arr[i+1])
            if((arr[i+1]-1) >= 0){
               arr[i] = arr[i+1] - 1;
               i--;
            }
            else
            	track = 0;
         }else {
           if(arr[i] >= arr[i-1])
             if((arr[i-1]-1) >= 0)
                arr[i] = arr[i-1] - 1;
             else
             	track = -1

                                        // 0 1 1 0
         }
     }

     if(track != -1)
     	std::cout<<"YES\n";
     else
     	std::cout<<"NO\n";

   }

	return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<iostream>
using namespace std;

int main()
{
    long long int t;
    scanf("%lld",&t);

    while(t--)
    {
      long long int n,p,f=0,ar[300010]={0};
      cin>>n;

       if(n%2==0)
         p=(n/2)-1;
       else
         p=n/2;

      for(long long int i=0;i<n;i++)
          scanf("%lld",&ar[i]);

      for(long long int i=0;i<=p;i++)
        {
          if(ar[i]<i || ar[n-1-i]<i)
            { f=1; break; }

          if(n%2==0 && ar[n/2]==ar[(n/2)-1] && ar[n/2]<n/2)
            { f=1; break; }
        }

        if(f==1)
          cout<<"No\n";
        else
          cout<<"Yes\n";

    }

return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;

int T;
int n;
int x;

int main()
{
	scanf_s("%d",&T);
	bool up, down,flag;

	while (T--)
	{
		up = 0;
		down = 0;
		flag = 0;

		scanf_s("%d", &n);
		scanf_s("%d", &x);
		if (x < n - 1)
			up = true;

		for(int i=1;i<n;i++)
		{
			scanf_s("%d", &x);
			if (!flag)
			{
				if (up && x < i)
					flag = true;
				else if (down && x < n - 1 - i)
					flag = true;

				if (!down)
				{
					if (x < i)
						down = true;

					if (x < n - 1 - i)
						up = true;
					else
						up = false;
				}

				if (up&&down)
					flag = true;
			}
		}

		if (!flag)
			printf("Yes\n");
		else
			printf("No\n");
	}

	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;

int arr[300005];
int main()
{
	ios::sync_with_stdio(false);
	int t;
	cin >> t;
	while (t--) {
		memset(arr, 0, sizeof(arr));
		int n;
		cin >> n;

		for (int i = 0; i < n; i++) {
			cin >> arr[i];
		}
		int l = -1, r = n;
		for (int i = 0; i < n; i++) {
			if (arr[i] < i)break;
			l = i;
		}
		for (int i = n - 1; i >= 0; i--) {
			if (arr[i] < n - i - 1)break;
			r = i;
		}
		if (l >= r)
			cout << "Yes\n";
		else
			cout << "No\n";
	}
	return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){

    int t;
    cin>>t;

    while(t--){

        int n;
        cin>>n;

        vector<int> v(n,0);

        for(int i=0;i<n;i++)
            cin>>v[i];

        int ans =0;
        int trend =0;
        int set = 0;
        for(int i=0;i<n;i++){

            if(trend ==0){
                if(v[i]>=i){
                }
                else{
                    trend = 1;
                    i--;
                    set = i;
                }
            }
            else{
                if(v[i]>=set-(i-set) && set-(i-set)>=0){
                }
                else{
                    ans = -1;
                }
            }
        }

        if(ans == 0 ){
        cout<<"Yes\n";
        continue;
        }

        for(int i=n-1;i>=0;i--){

            if(v[i]<n-1-i){
                cout<<"No\n";
                ans = 0;
                break;
            }

        }

        if(ans==-1){
        cout<<"Yes\n";
        }

    }

    return 0;
}


#include<iostream>
#include<vector>
using namespace std;

int main(){

    int t;
    cin>>t;

    while(t--){

        int n;
        cin>>n;

        vector<int> v(n,0);

        for(int i=0;i<n;i++)
            cin>>v[i];

        int ans =0;
        int trend =0;
        int set = 0,set1=0;
        for(int i=0;i<n;i++){

            if(trend ==0){
                if(v[i]>=i){
                }
                else{
                    trend = 1;
                    i--;
                    set = i;
                    set1 = i;
                }
            }
            else{
                if(v[i]>=set-(i-set) && set-(i-set)>=0){
                }
                else{
                    ans = -1;
                }
            }
        }

        if(ans == 0 ){
        cout<<"Yes\n";
        continue;
        }

        for(int i=n-1;i>=set;i--){

            if(v[i]<n-1-i){
                cout<<"No\n";
                ans = 0;
                break;
            }

        }

        if(ans==-1){
        cout<<"Yes\n";
        }

    }

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <list>
#include <set>
#include <cmath>
#include <stack>
#include <map>
//#include<bits/stdc++.h>

using namespace std;
#define For(i, n) for(int i = 0; i < n; i++)
typedef  long long ll;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    int ma = 0;
    For(i, n) {
        cin >> a[i];
        if (a[ma] < a[i])
            ma = i;
    }

    for (int i = 0; i < ma; i++) {
        if (a[i] >= a[i + 1]) {
            if (a[i + 1] == 0) {
                cout << "No" << "\n";
                return;
            }
            a[i] = a[i + 1] - 1;
        }
    }
    for (int i = ma + 1; i < n; i++) {
        if (a[i] >= a[i - 1]) {
            if (a[i - 1] == 0) {
                cout << "No" << "\n";
                return;
            }
        }
        a[i] = a[i - 1] - 1;
    }
    cout << "Yes" << "\n";
    return;
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <list>
#include <set>
#include <cmath>
#include <stack>
#include <map>
//#include<bits/stdc++.h>

using namespace std;
#define For(i, n) for(int i = 0; i < n; i++)
typedef  long long ll;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);

    For(i, n) {
        cin >> a[i];
    }
    int i = 0;
    for (i = 0; i < n; i++) {
        if (a[i] < i) {
            break;
        }
    }

    for (i; i < n; i++) {
        if (a[i] >= a[i - 1]) {
            if (a[i - 1] == 0) {
                cout << "No" << "\n";
                return;
            }
            a[i] = a[i - 1] - 1;
        }
    }
    cout << "Yes" << "\n";
    return;
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <list>
#include <set>
#include <cmath>
#include <stack>
#include <map>
//#include<bits/stdc++.h>

using namespace std;
#define For(i, n) for(int i = 0; i < n; i++)
typedef  long long ll;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    int ma = 0;
    For(i, n) {
        cin >> a[i];
        if (a[ma] < a[i])
            ma = i;
    }

    for (int i = 0; i < ma; i++) {
        if (a[i] < i) {
            cout << "No" << "\n";
            return;
        }
        a[i] = i;
        //cout << a[i]<< i << ma << " ";
        if (a[i] >= a[i + 1]) {
            if (a[i + 1] == 0) {
                cout << "No" << "\n";
                return;
            }
        }
    }

    for (int i = ma + 1; i < n; i++) {
        if (a[i] >= a[i - 1]) {
            if (a[i - 1] == 0) {
                cout << "No" << "\n";
                return;
            }
            a[i] = a[i - 1] - 1;
        }

    }
    cout << "Yes" << "\n";
    return;
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <list>
#include <set>
#include <cmath>
#include <stack>
#include <map>
//#include<bits/stdc++.h>

using namespace std;
#define For(i, n) for(int i = 0; i < n; i++)
typedef  long long ll;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    int ma = 0;
    For(i, n) {
        cin >> a[i];
        if (a[ma] < a[i])
            ma = i;
    }

    for (int i = 0; i < ma; i++) {
        if (a[i] >= a[i + 1]) {
            if (a[i + 1] == 0) {
                cout << "No" << "\n";
                return;
            }
            a[i] = a[i + 1] - 1;
        }
    }
    for (int i = ma + 1; i < n; i++) {
        if (a[i] >= a[i - 1]) {
            if (a[i - 1] == 0) {
                cout << "No" << "\n";
                return;
            }
            a[i] = a[i - 1] - 1;
        }

    }
    cout << "Yes" << "\n";
    return;
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}


#include <iostream>

using namespace std;

int main()
{
    int t,n,a[300001],k,m,flag;
    cin>>t;
    for(int i=0;i<t;i++){
        flag=0;
        cin>>n;
        for(int j=0;j<n;j++) cin>>a[j];
        for(int j=0;j<n;j++){
            if(j+1<n){
                if(a[j+1]<a[j]){
                    if(j+2<n){
                       if(a[j+2]<a[j+1]){k=j;break;}
                    }
                    else {k=j;break;}
                }
            }
            else {k=j;break;}
        }
        m=a[k]-1;
        for(int j=k-1;j>=0;j--){
            if(m<0){
                flag=1;
                break;
            }
            if(a[j]<m) m=a[j];
            else a[j]=m;
            m--;
        }
        m=a[k]-1;
        for(int j=k+1;j<n;j++){
            if(m<0){
                flag=1;
                break;
            }
            if(a[j]<m) m=a[j];
            else a[j]=m;
            m--;
        }
        if(flag==0) cout<<"YES\n";
        else cout<<"NO\n";
    }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int t,n,a[300001],p,s;
    cin>>t;
    for(int i=0;i<t;i++){
        p=0;s=0;
        cin>>n;
        for(int j=0;j<n;j++) cin>>a[j];
        for(int j=0;j<n;j++){
            if(a[j]>=j) p++;
            else break;
        }
        for(int j=n-1;j>=0;j--){
            if(a[j]>=(n-1-j)) s++;
            else break;
        }
        if((p+s)>n) cout<<"YES\n";
        else cout<<"NO\n";
    }

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int t,n,a[300001],k,m,flag;
    cin>>t;
    for(int i=0;i<t;i++){
        flag=0;
        cin>>n;
        for(int j=0;j<n;j++) cin>>a[j];
        for(int j=0;j<n;j++){
            if(j+1<n){
                if(a[j+1]<a[j]){
                    if(j+2<n){
                       if(a[j+2]<a[j+1]){k=j;break;}
                    }
                    else {k=j;break;}
                }
            }
            else for(int l=n-1;l>=0;l--){
                if(l-1>=0){
                    if(a[l]>a[l-1]||(a[l]==a[l-1]&&l==1)){k=l;break;}
                }
            }
        }
        m=a[k]-1;
        for(int j=k-1;j>=0;j--){
            if(m<0){
                flag=1;
                break;
            }
            if(a[j]<m) m=a[j];
            else a[j]=m;
            m--;
        }
        m=a[k]-1;
        for(int j=k+1;j<n;j++){
            if(m<0){
                flag=1;
                break;
            }
            if(a[j]<m) m=a[j];
            else a[j]=m;
            m--;
        }
        if(flag==0) cout<<"YES\n";
        else cout<<"NO\n";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,front,back;
		bool flag = true;
		front = -1;
		cin >> n;
		back = n;
		vector<int> in(n);
		for (int i = 0; i < n; i++)
		{
			cin >> in[i];
		}
		for (int i = 0; i < n; i++)
		{
			if (in[i] < i)
			{
				front = i;
				break;
			}
		}
		for (int i = n - 1; i > -1; i--)
		{
			if (in[i] < (n-1) - i)
			{
				back = i;
				break;
			}
		}
		if (front >= back)
		{
			cout << "No" << endl;
		}
		else
		{
			cout << "Yes" << endl;
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,front,back;
		cin >> n;
		front = -1;
		back = n;
		vector<int> in(n);
		for (int i = 0; i < n; i++)
		{
			cin >> in[i];
		}
		for (int i = 0; i < n; ++i)
		{
			if (in[i] < i)
			{
				break;
			}
			front = i;
		}
		for (int i = n - 1; i >= 0; --i)
		{
			if (in[i] < (n-1) - i)
			{
				break;
			}
			back = i;
		}
		if (back <= front)
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout <<"No"<<endl;
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;

vector<int> sort(vector<int> a, bool b)
{
	if (b)
		sort(a.begin(), a.end(), greater<int>());
	else
		sort(a.begin(), a.end());
	return a;
}
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,front,back;
		bool flag = true;
		front = -1;
		cin >> n;
		back = n;
		vector<int> in(n);
		for (int i = 0; i < n; i++)
		{
			cin >> in[i];
		}
		for (int i = 0; i < n; i++)
		{
			if (in[i] < i)
			{
				front = i;
				break;
			}
		}
		for (int i = n - 1; i > -1; i--)
		{
			if (in[i] < (n-1) - i)
			{
				back = i;
				break;
			}
		}
		if (front >= back)
		{
			cout << "No" << endl;
		}
		else
		{
			cout << "Yes" << endl;
		}
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int s[300010];
int a[300010];
int b[300010];
int main() {
	int t;
	int n;
	cin >> t;
	while (t--) {
		scanf("%d", &n);
		for (int i = 0; i < n; i++) {
			scanf("%d", &s[i]);
			a[i] = b[i] = 0;
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (s[i] - cnt >= 0)
				a[i] = 1;
			if (s[i]  - (n - 1 -cnt) >= 0)
				b[i] = 1;
			cnt++;
		}
		int i, j;
		for (i = 0; i < n; i++)
			if (a[i] == 0)
				break;
		if(i != n)
		i--;
		for (j = n - 1; j >= 0; j--)
			if (b[j] == 0)
				break;
		if(j != -1)
		j++;
		if (j <= i)
			printf("Yes\n");
		else
			printf("No\n");
	}

	return 0;
}


#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<cstdio>
#include<string>
#include<vector>
#include<fstream>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define inf 0x3f3f3f3f
using namespace std;

char s[3500];
int a[3500];

int main()
{
	int t;
	scanf_s("%d", &t);
	while (t--)
	{
		int n;
		scanf_s("%d", &n);
		for (int i = 1; i <= n; i++) scanf_s("%d", &a[i]);
		int l = 0, r = n + 1;
		for (int i = 1; i <= n; i++)
			if (a[i] >= i - 1) l++;
			else break;
		for (int i = n; i >= 1; i--)
			if (a[i] >= n - i) r--;
			else break;
		if (r <= l) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}


#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<cstdio>
#include<string>
#include<vector>
#include<fstream>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define inf 0x3f3f3f3f
using namespace std;

int a[350000];

int main()
{
	int t;
	scanf_s("%d", &t);
	while (t--)
	{
		int n;
		scanf_s("%d", &n);
		for (int i = 1; i <= n; i++) scanf_s("%d", &a[i]);
		int l = 0, r = n + 1;
		for (int i = 1; i <= n; i++)
			if (a[i] >= i - 1) l++;
			else break;
		for (int i = n; i >= 1; i--)
			if (a[i] >= n - i) r--;
			else break;
		if (r <= l) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}


#include <iostream>
#include <ctime>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <cmath>
#include <cstring>
#include <Windows.h>
#include <sstream>
#include <typeinfo>

using namespace std;

int main()
{

	int t;
	cin >> t;
	for (int q = 0; q < t; q++)
	{
		int n;
		cin >> n;
		long long *arr = new long long[n];
		long long max = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> arr[i];

		}

		for (int i = 0; i < n; i++)
		{
			if (arr[i] < i)
			{
				if (arr[i - 1] > i - 1)
				{
					for (int j = i; j < n; j++)
					{
						if (arr[j] < (n - j - 1))
						{
							cout << "NO" << endl;
							i = n;
							j = n;
						}

					}
				}
				else
				{
					if (n % 2)
					{
						for (int j = i; j < n; j++)
						{
							if (arr[j] < (n - j-1))
							{
								cout << "NO" << endl;
								i = n;
								j = n;
							}

						}
					}
					else
					{
						for (int j = i; j < n; j++)
						{
							if (arr[j] < (n - j))
							{
								cout << "NO" << endl;
								i = n;
								j = n;
							}

						}
					}
				}

			}
			if (i + 1 == n)
			{
				cout << "YES" << endl;
			}
		}

		delete arr;
	}
	return 0;
}


#include <iostream>
#include <ctime>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <cmath>
#include <cstring>
#include <Windows.h>
#include <sstream>
#include <typeinfo>

using namespace std;

int main()
{

	int t;
	cin >> t;
	for (int q = 0; q < t; q++)
	{
		int n;
		cin >> n;
		long long *arr = new long long[n];
		long long max = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> arr[i];

		}

		for (int i = 0; i < n; i++)
		{
			if (arr[i] < i)
			{
				if (n % 2)
				{
					for (int j = i; j < n; j++)
					{
						if (arr[j] < (n - j - 1))
						{
							cout << "NO" << endl;
							i = n;
							j = n;
						}

					}
				}
				else
				{
					if (arr[i - 1] == i - 1)
					{
						for (int j = i; j < n; j++)
						{
							if (arr[j] < (n - j))
							{
								cout << "NO" << endl;
								i = n;
								j = n;
							}

						}
					}
					else
					{
						for (int j = i; j < n; j++)
						{
							if (arr[j] < (n - j - 1))
							{
								cout << "NO" << endl;
								i = n;
								j = n;
							}

						}
					}
				}

			}
			if (i + 1 == n)
			{
				cout << "YES" << endl;
			}
		}

		delete arr;
	}
	return 0;
}


#include <iostream>
#include <ctime>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <cmath>
#include <cstring>
#include <Windows.h>
#include <sstream>
#include <typeinfo>

using namespace std;

int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		long long n;
		cin >> n;
		long long *arr = new long long[n];
		for (long long j = 0; j < n; j++)
		{
			cin >> arr[j];
		}

		if (arr[n / 2] == n / 2 - 1 && arr[n / 2 - 1] == n / 2 - 1)
		{
			cout << "NO" << endl;
		}
		else
		{
			for (long long j = 0; j < n; j++)
			{

				if (arr[j] < j && arr[j] < (n - 1 - j))
				{
					cout << "NO" << endl;
					break;
				}

				if (j + 1 == n)
				{
					cout << "YES" << endl;
				}
			}
		}

		delete arr;
	}
	return 0;
}


#include <iostream>
#include <ctime>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <cmath>
#include <cstring>
#include <Windows.h>
#include <sstream>
#include <typeinfo>

using namespace std;

int main()
{

	int t;
	cin >> t;
	for (int q = 0; q < t; q++)
	{
		long long n;
		cin >> n;
		long long *arr = new long long[n];
		long long max = 0;
		for (long long i = 0; i < n; i++)
		{
			cin >> arr[i];

		}

		for (long long i = 0; i < n; i++)
		{
			if (arr[i] < i)
			{
				if (n % 2)
				{
					for (long long j = i; j < n; j++)
					{
						if (arr[j] < (n - j - 1))
						{
							cout << "NO" << endl;
							i = n;
							j = n;
						}

					}
				}
				else
				{
					if (arr[i - 1] == i - 1)
					{
						for (long long j = i; j < n; j++)
						{
							if (arr[j] < (n - j))
							{
								cout << "NO" << endl;
								i = n;
								j = n;
							}

						}
					}
					else
					{
						for (long long j = i; j < n; j++)
						{
							if (arr[j] < (n - j - 1))
							{
								cout << "NO" << endl;
								i = n;
								j = n;
							}

						}
					}
				}

			}
			if (i + 1 == n)
			{
				cout << "YES" << endl;
			}
		}

		delete arr;
	}
	return 0;
}


#include<stdio.h>
int main(){
	int a,b,n,num,i,j,flag,sum,flag1;
	int str[300000];
	scanf("%d",&n);
    for(i=0;i<n;i++){
    	flag=0;
    	scanf("%d",&num);
    	for(j=0;j<num;j++){
    		scanf("%d",&str[j]);
		}
		if(num==1){
		   printf("Yes\n");
		}else if(num==2){
			if(str[0]==0&&str[1]==0){
				printf("No\n");
			}else {
				printf("Yes\n");
			}
		}else {
			for(j=0;j<=num/2;j++){
				if(str[j]<j){

					flag=1;
				}
			}

			for(j=num-1;j>=num/2;j--){
				if(str[j]<num-j-1){

					flag=1;
				}
			}
			if((str[num/2]>=num/2||(str[num/2-1]>=num/2))&&num%2==0)flag=0;
			if(flag==0)printf("Yes\n");else printf("No\n");
		}
	}
}


#include<stdio.h>
int main(){
	int a,b,n,num,i,j,flag,sum,flag1;
	int str[300000];
	scanf("%d",&n);
    for(i=0;i<n;i++){
    	flag=0;
    	scanf("%d",&num);
    	for(j=0;j<num;j++){
    		scanf("%d",&str[j]);
		}
		if(num==1){
		   printf("Yes\n");
		}else if(num==2){
			if(str[0]==0&&str[1]==0){
				printf("No\n");
			}else {
				printf("Yes\n");
			}
		}else {
			if(num%2==0){
				for(j=0;j<=num/2-1;j++){
				   if(str[j]<j){

					flag=1;
				   }
			    }

			    for(j=num-1;j>=num/2;j--){
				   if(str[j]<num-j-1){

					flag=1;
				   }
			    }
			    if((str[num/2]<num/2&&(str[num/2-1]<num/2))&&num%2==0)flag=1;
			}else {
				for(j=0;j<=num/2;j++){
				   if(str[j]<j){

					flag=1;
				   }
			    }

			    for(j=num-1;j>=num/2;j--){
				   if(str[j]<num-j-1){

					flag=1;
				   }
			    }
			}

			if(flag==0)printf("Yes\n");else printf("No\n");
		}
	}
}


#include<stdio.h>
int main(){
	int a,b,n,num,i,j,flag,sum,flag1;
	int str[300000];
	scanf("%d",&n);
    for(i=0;i<n;i++){
    	flag=0;
    	scanf("%d",&num);
    	for(j=0;j<num;j++){
    		scanf("%d",&str[j]);
		}
		if(num==1){
		   printf("Yes\n");
		}else if(num==2){
			if(str[0]==0&&str[1]==0){
				printf("No\n");
			}else {
				printf("Yes\n");
			}
		}else {
			for(j=0;j<=num/2;j++){
				if(str[j]<j){

					flag=1;
				}
			}

			for(j=num-1;j>=num/2;j--){
				if(str[j]<num-j-1){

					flag=1;
				}
			}
			if(flag==0)printf("Yes\n");else printf("No\n");
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
int ar[300050];
void solve(){
    int N,i,tmp,pl,pr;
    bool flag=true;
    cin>>N;
    if(N==1)
        cin>>ar[1];
    else if(N==2){
        cin>>ar[1]>>ar[2];
        if(ar[1]+ar[2]==0)
            flag=false;
    }
    else if(N>=3){
        for(i=0;i<N;i++)
            cin>>ar[i];
        for(i=0;i<N;i++)
            if(ar[i]<i){
                pl=i-1;
                break;
            }
        if(i==N)
            pl=N-1;
        for(i=N-1;i>=0;i--)
            if(ar[i]<N-i-1){
                pr=i+1;
                break;
            }
        if(i==-1)
            pr=0;
        if(pl<pr)
            flag=false;
    }
    cout<<(flag?"Yes\n":"No\n");
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int T;cin>>T;while(T--)
        solve();

    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long int lint;
int main()
{
	lint test_num, arr_size, temp_in, flag_pr;
	vector<lint> vec_in;
	vector<lint> vec_empty;

	cin >> test_num;
	for (lint i = 0; i < test_num; ++i)
	{
		vec_in = vec_empty;
		cin >> arr_size;
		if (arr_size % 2 != 0) //奇数
		{
			for (lint j = 0; j < arr_size; ++j)
			{
				cin >> temp_in;
				vec_in.push_back(temp_in);
			}
			lint k;
			for (k = 0; k < arr_size; k++)
			{
				if (k <= vec_in[k])
					;
				else
					break;
			}
			if (k == arr_size)
				cout << "Yes" << endl;
			else
			{
				lint z;
				for (z = arr_size - 1; z >= 0; z--)
				{
					if ((arr_size - z - 1) <= vec_in[z])
						;
					else
						break;
				}
				if (k - 1 == z + 1)
				{
					cout << "Yes" << endl;
				}
				else
				{
					cout << "No" << endl;
				}
			}
		}
		else		//偶数
		{
			if(arr_size)
			for (lint j = 0; j < arr_size; ++j)
			{
				cin >> temp_in;
				vec_in.push_back(temp_in);
			}
			lint k;
			for (k = 0; k < arr_size; k++)
			{
				if (k <= vec_in[k])
					;
				else
					break;
			}
			if (k == arr_size)
				cout << "Yes" << endl;
			else
			{
				lint z;
				for (z = arr_size - 1; z >= 0; z--)
				{
					if ((arr_size - z - 1) <= vec_in[z])
						;
					else
						break;
				}

				if (k-1 == z+1)
				{
					cout << "Yes" << endl;
				}
				else
				{
					if (k == arr_size / 2  && z == arr_size / 2 -1 && vec_in[k] == vec_in[z] && vec_in[k] >= k)
					{
						cout << "Yes" << endl;
					}
					else
						cout << "No" << endl;
				}
			}
		}

	}
}


#include<iostream>
#include<vector>
#include<string>
using namespace std;
int ar[300050];
void solve() {
    int N, i, tmp, pl, pr;
    bool flag = true;
    cin >> N;
    if (N == 1)
        cin >> ar[1];
    else if (N == 2) {
        cin >> ar[1] >> ar[2];
        if (ar[1] + ar[2] == 0)
            flag = false;
    }
    else if (N >= 3) {
        for (i = 0; i < N; i++)
            cin >> ar[i];
        for (i = 0; i < N; i++)
            if (ar[i] < i) {
                pl = i - 1;
                break;
            }
        if (i == N)
            pl = N - 1;
        for (i = N - 1; i >= 0; i--)
            if (ar[i] < N - i - 1) {
                pr = i + 1;
                break;
            }
        if (i == -1)
            pr = 0;
        if (pl < pr)
            flag = false;
    }
    cout << (flag ? "Yes\n" : "No\n");
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int T; cin >> T; while (T--)
        solve();

    return 0;
}


#include<iostream>
using namespace std;
int a[300002];
int main()
{
	int N,n,i;
	cin>>N;
	while(N--)
		{cin>>n;
		 int loc=-1,loc2=-1,flag=0,f2=0,f3=0;
		 cin>>a[0];
		 for(i=1;i<n;i++)
		 	{cin>>a[i];
		 	 if(a[i-1]<a[i]);
		 	 else if(flag==0)
		 	 	loc=i-1,flag=1;
			}
//			cout<<"loc="<<loc<<endl;
		 if(flag)
			{for(i=0;i<n-loc;i++)
			 	if(a[n-1-i]<i)
			 		{loc2=n-1-i;f2=1;break;}
			 if(f2==0)cout<<"Yes"<<endl;
			 else
			 	{for(i=0;i<=loc2+1;i++)
			 		if(a[i]<i)
			 			{cout<<"No"<<endl;f3=1;break;}
			 	 if(f3==0)cout<<"Yes"<<endl;
				}
			}
		 else cout<<"Yes"<<endl;
		}
	return 0;
}


#include<iostream>
using namespace std;
int a[300002];
int main()
{
	int N,n,i;
	cin>>N;
	while(N--)
		{cin>>n;
		 int loc=-1,flag=0,f2=0;
		 cin>>a[0];
		 for(i=1;i<n;i++)
		 	{cin>>a[i];
		 	 if(a[i-1]<a[i]);
		 	 else if(flag==0)
		 	 	loc=i-1,flag=1;
			}
		 if(flag)
			{for(i=0;i<n-loc;i++)
			 	if(a[n-1-i]<i)
			 		{cout<<"No"<<endl;f2=1;break;}
			 if(f2==0)cout<<"Yes"<<endl;
			}
		 else cout<<"Yes"<<endl;
		}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <set>

using namespace std;

typedef long long ll;

int tcase;
int n;
int a[300005];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		cin >> n;

		for (int i = 0; i < n; i++)
		{
			scanf_s("%d", &a[i]);
		}

		int i, j, s;
		i = 0;
		j = n - 1;

		s = 0;
		while (i < n)
		{
			if (a[i] < s)
			{
				i--;
				break;
			}

			i++;
			s++;
		}

		s = 0;
		while (j >= 0)
		{
			if (a[j] < s)
			{
				j++;
				break;
			}

			j--;
			s++;
		}

		if(i >= j) cout << "Yes" << '\n';
		else cout << "No" << '\n';
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <set>

using namespace std;

typedef long long ll;

int tcase;
int n;
int a[300005];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		cin >> n;

		for (int i = 0; i < n; i++)
		{
			scanf_s("%d", &a[i]);
		}

		string ans = "Yes";

		int s = 0;
		int i = 0;
		while (i < n)
		{
			if (a[i] < s)
			{
				s = a[i - 1] - 1;
				break;
			}

			s++;
			i++;
		}

		while (i < n)
		{
			if (a[i] < s || s < 0)
			{
				ans = "No";
				break;
			}

			s--;
			i++;
		}

		cout << ans << '\n';
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <math.h>
#include <stack>
#include <string>
#include <set>

using namespace std;

typedef long long ll;

int tcase;
int n;
int a[300005];

int main()
{
	cin >> tcase;
	while (tcase--)
	{
		cin >> n;
		a[0] = -1;
		for (int i = 1; i <= n; i++)
		{
			scanf_s("%d", &a[i]);
		}
		a[n + 1] = -1;
		int cnt = 0;
		bool isOk = true;
		int prev = a[0];

		for (int i = 1; i <= n+1; i++)
		{
			if (prev == a[i] && abs(a[i] - a[i - 2]) < 2)
			{
				isOk = false;
				break;
			}

			if (cnt == 0)
			{
				if (prev > a[i] && a[i] - a[i - 2] < 2 && a[i] - a[i - 2] >= 0) cnt++;
			}
			else
			{
				if (prev < a[i] && a[i - 2] - a[i] < 2 && a[i - 2] - a[i] >= 0)
				{
					isOk = false;
					break;
				}
			}

			prev = a[i];
		}

		if (isOk) cout << "Yes" << '\n';
		else cout << "No" << '\n';
	}
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, m, a, p, i, last;
	cin >> n;
	while (n--) {
		p = 0;
		a = -1;
		cin >> m;
		for (i = 0; i < m;i++) {
			last = a;
			cin >> a;
			if (p == 0 && a < i) {
				p = 1;
				if (a < m - i - 1 ||(m % 2 == 0 && i == m/2 && last == i-1))
					p = 2;
			}
			else if(p == 1 && a < m - i - 1)
					p = 2;
		}
		if (p == 2)
			cout << "No" << endl;
		else
			cout << "Yes" << endl;
	}
	return 0;
}


#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <math.h>

#define ll long long
#define ull unsigned long long

using namespace std;

void solve() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; ++i)
		cin >> a[i];

	if (n & 1) {
		int l = -2;
		for (int i = 0; i < n; ++i)
			if (a[i] < i) {
				l = i - 1;
				break;
			}

		int r = -2;
		for (int i = n - 1; i >= 0; --i)
			if (a[i] < n - i - 1) {
				r = i + 1;
				break;
			}

		if (l == -2 || r == -2 || r - l <= 1)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	else {
		int l1 = -2;
		for (int i = 0; i < n; ++i)
			if (a[i] < i) {
				l1 = i - 1;
				break;
			}

		int r1 = -2;
		for (int i = n - 1; i >= 0; --i)
			if (a[i] <= n - i - 1) {
				r1 = i + 1;
				break;
			}

		int l2 = -2;
		for (int i = 0; i < n; ++i)
			if (a[i] <= i) {
				l2 = i - 1;
				break;
			}

		int r2 = -2;
		for (int i = n - 1; i >= 0; --i)
			if (a[i] < n - i - 1) {
				r2 = i + 1;
				break;
			}

		if (l1 == -2 || r1 == -2 || l2 == -2 || r2 == -2 || r1 - l1 <= 1 || r2 - l2 <= 1)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}

}

int main() {
	int t = 1;
	cin >> t;
	for (int i = 0; i < t; ++i)
		solve();
	return 0;
}


#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <math.h>

#define ll long long
#define ull unsigned long long

using namespace std;

void solve() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; ++i)
		cin >> a[i];

	if (n & 1) {
		bool ans = true;
		for (int i = 0; i < n / 2; ++i)
			ans &= (a[i] >= i);
		for (int i = n / 2; i < n; ++i)
			ans &= (a[i] >= n - i - 1);
		cout << (ans ? "Yes" : "No") << endl;
	}
	else {
		bool ans1 = true;
		for (int i = 0; i < n / 2; ++i)
			ans1 &= (a[i] >= i);
		for (int i = n / 2; i < n; ++i)
			ans1 &= (a[i] > n - i - 1);
		bool ans2 = true;
		for (int i = 0; i < n / 2; ++i)
			ans2 &= (a[i] > i);
		for (int i = n / 2; i < n; ++i)
			ans2 &= (a[i] >= n - i - 1);
		cout << ((ans1 || ans2) ? "Yes" : "No") << endl;
	}

}

int main() {
	int t = 1;
	cin >> t;
	for (int i = 0; i < t; ++i)
		solve();
	return 0;
}


#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <math.h>

#define ll long long
#define ull unsigned long long

using namespace std;

void solve() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; ++i)
		cin >> a[i];

	bool ans = true;
	for (int i = 0; i < n / 2; ++i)
		ans &= (a[i] >= i);
	for (int i = n / 2; i < n; ++i)
		ans &= (a[i] >= n - i - 1);

	if (n & 1)
		cout << (ans ? "Yes" : "No") << endl;
	else {
		bool f = (a[n / 2] > n / 2 - 1) || (a[n / 2 - 1] > n / 2 - 1);
		cout << (ans && f ? "Yes" : "No") << endl;
	}
}

int main() {
	int t = 1;
	cin >> t;
	for (int i = 0; i < t; ++i)
		solve();
	return 0;
}


#include<iostream>
using namespace std;

int main()
{
    int t;//样例的个数
    int fro,bak;
    int each;//每个有多少；
    cin>>t;
    for(int i=0; i<t; i++)
    {
        int x1;
        fro=bak=-1;
        cin>>each;
        int flag1=2;
        if(each==1)
        {
            cin>>fro;
            cout<<"YES"<<endl;
            continue;
        }

        if(each%2)
        {
            for( x1=0; x1<each; x1++)
            {
                cin>>fro;
                if(fro>=x1||fro>=each-x1-1)
                    flag1=flag1;
                else
                    flag1=0;

            }
            if(flag1)
                cout<<"YES"<<endl;
            else
                cout<<"NO"<<endl;
        }
        if(each%2==0){
            for( x1=0; x1<each; x1++)
            {
                cin>>fro;
                if(fro>=x1||fro>=each-x1-1)
                    flag1=flag1;
                else
                    flag1=0;
                if(x1==each/2-1)
                {
                    if(fro==each/2-1)flag1--;
                }
                if(x1==each/2)
                    if(fro==each/2-1)flag1--;

            }
        if(flag1)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
        }

    }
}


#include<iostream>
using namespace std;

int main()
{
    int t;//样例的个数
    int fro,bak;
    int each;//每个有多少；
    cin>>t;
    for(int i=0; i<t; i++)
    {
        int x1;
        fro=bak=-1;
        cin>>each;
        int flag1=2;
        if(each==1)
        {
            cin>>fro;
            cout<<"Yes"<<endl;
            continue;
        }

        if(each%2)
        {
            for( x1=0; x1<each; x1++)
            {
                cin>>fro;
                if(fro>=x1||fro>=each-x1-1)
                    flag1=flag1;
                else
                    flag1=0;

            }
            if(flag1)
                cout<<"Yes"<<endl;
            else
                cout<<"No"<<endl;
        }
        if(each%2==0){
            for( x1=0; x1<each; x1++)
            {
                cin>>fro;
                if(fro>=x1||fro>=each-x1-1)
                    flag1=flag1;
                else
                    flag1=0;
                if(x1==each/2-1)
                {
                    if(fro==each/2-1)flag1--;
                }
                if(x1==each/2)
                    if(fro==each/2-1)flag1--;

            }
        if(flag1)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
        }

    }
}


#include<iostream>
using namespace std;

int main()
{
    int t;//样例的个数
    int fro,bak;
    int each;//每个有多少；
    cin>>t;
    for(int i=0; i<t; i++)
    {
        int x1;
        fro=bak=-1;
        cin>>each;
        int flag1=2;
        if(each==1)
        {
            cin>>fro;
            cout<<"Yes"<<endl;
            continue;
        }

        if(each%2)
        {
            for( x1=0; x1<each; x1++)
            {
                cin>>fro;
                if(fro>=x1||fro>=each-x1-1)
                    flag1=flag1;
                else
                    flag1=0;

            }
            if(flag1)
                cout<<"Yes"<<endl;
            else
                cout<<"No"<<endl;
        }
        if(each%2==0){
            for( x1=0; x1<each; x1++)
            {
                cin>>fro;
                if(fro>=x1||fro>=each-x1-1)
                    flag1=flag1;
                else
                    flag1=0;
                if(x1==each/2-1&&flag1==2)
                {
                    if(fro==each/2-1)flag1--;
                }
                if(x1==each/2&&flag1==1)
                    if(fro==each/2-1)flag1--;

            }
        if(flag1)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
        }

    }
}


#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
//#include <map>
#include <set>
#include <stack>
#include <cstring>

using namespace std;
#define MAX_SIZE 100
#define INF 0x7fffffff

int main() {

    int t; cin >> t;

    while (t--) {

        int n; cin >> n;

        bool find = true;
        vector<int> origin(n);
        for (int i = 0; i < n; i++) cin >> origin[i];

        vector<int> assent(n);

        assent[0] = 0;
        for (int i = 1; i < n; i++) {
            if (assent[i - 1] != -1 && assent[i - 1] < origin[i]) {
                assent[i] = i;
            }
            else {
                assent[i] = -1;
            }
        }
        vector<int> rev = origin;
        reverse(rev.begin(), rev.end());
        vector<int> dessent(n);
        dessent[0] = 0;
        for (int i = 1; i < n; i++) {
            if (dessent[i - 1] != -1 && dessent[i - 1] < rev[i]) {
                dessent[i] = i;
            }
            else {
                dessent[i] = -1;
            }
        }

        int cand = 0;
        for (int i = 0; i < n; i++) {
            if (dessent[i] == -1)
                cand++;
            if (assent[i] == -1)
                cand++;
        }

        if (cand < n) {
            cout << "Yes" << "\n";
        }
        else {
            cout << "No" << "\n";
        }

    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
using namespace std;

int n, w[301000];

void Process() {
	int i;
	scanf("%d", &n);
	int Mn = 1e9;
	int Mx = 0;
	for (i = 1; i <= n; i++) {
		scanf("%d", &w[i]);
		if (w[i] < i - 1)Mn = min(Mn, i);
		if (w[i] < n - i)Mx = max(Mx, i);
	}
	if (Mx + 1 <= Mn - 1) {
		puts("Yes");
	}
	else puts("No");
}

int main() {
	int Tcase;
	scanf("%d", &Tcase);
	while (Tcase--) {
		Process();
	}
}


#include <iostream>
#include <utility>
#include <set>
#include <vector>
#include<algorithm>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;

        vector<int> a(n);
        bool flag = true;

        for (int i = 0; i < n; ++i)
        {
            cin >> a[i];
        }

        int i = 0;
        while (i<n && a[i] >= i )
        {
            ++i;
        }//����� �� ���������� ����������

        for (int j = i; j < n; ++j)
        {
            if (a[j] < a[j - 1]) {
                continue;
            }
            else {
                a[j] = a[j - 1] - 1;
                if (a[j] < 0) {
                    flag = false;
                    break;
                }
            }
        }
        if (flag) {
            cout << "YES";
        }
        else {
            cout << "NO";
        }
        cout << '\n';
    }
}


#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <assert.h>
#include <map>
#include <set>
#include <bitset>
#include <iomanip>
#include <stack>
// #include <unordered_map>
#include <cmath>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
// #define INF 0x7f7f7f7f  //2139062143
#define INF1 0x3f3f3f3f //1061109567
#define INF2 2147483647
#define llINF 9223372036854775807
#define pi 3.14159265358979323846264338327950254
#define pb push_back
#define ll long long
#define debug cout << "debug\n";
#define STDIN                      \
    freopen("in.txt", "r", stdin); \
    freopen("out.txt", "w", stdout);
#define IOS                      \
    ios::sync_with_stdio(false); \
    cin.tie(NULL);
#define scai(x) scanf("%d", &x)
#define sca2i(x, y) scanf("%d %d", &x, &y)
#define scaf(x) scanf("%lf", &x)
#define sca2f(x, y) scanf("%lf %lf", &x, &y)
#define For(m, n) for (int i = m; i < n; i++)
#define PII pair<int, int>
#define PLL pair<long, long>
#define ft first
#define sd second
#define pb push_back
#define ST(x, y, z) sort(x + y, x + z);
#define lson o << 1, l, mid
#define rson o << 1 | 1, mid + 1, r
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define ROF(i, a, b) for (int i = (a); i >= (b); i--)
#define MEM(x, v) memset(x, v, sizeof(x))
#define rep(i, a, b) for (register int i = a; i <= b; i++)
#define rrep(i, a, b) for (register int i = a; i >= b; i--)
#define PIII pair<int, PII>
#define re read()
#define case  \
    int T;    \
    cin >> T; \
    rep(_, 1, T)
// #define int ll
#define LL long long
#define int ll
inline int read()
{
    char tempt = getchar();
    int x = 0, f = 0;
    while (tempt < '0' || tempt > '9')
        f |= tempt == '-', tempt = getchar();
    while (tempt >= '0' && tempt <= '9')
        x = x * 10 + tempt - '0', tempt = getchar();
    return f ? -x : x;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

const int mod = 1e9 + 7;

const int N = 200000 + 10;

int a[N];
int b[N];
signed main()
{
    // STDIN
    case{
        int n;
        cin >> n;
        int j = -1;
        int maxn = -1;
        string ans = "YES";
        rep(i,0, n-1)
        {
            cin >> a[i];
            b[i] =a[i];
            if (a[i] >= i) a[i] = i;
            else {
                if (a[i] >= a[i-1]){
                    if (a[i-1] <= 0) ans = "NO";
                    else a[i] = a[i-1]-1;
                }
            }
        }
        reverse(b, b + n);
        string ans2 = "YES";
        rep(i, 0, n-1)
        {
            if (b[i] >= i) b[i] = i;
            else {
                if (b[i] >= b[i-1]){
                    if (b[i-1] <= 0) ans2 = "NO";
                    else b[i] = b[i-1] - 1;
                }
            }
        }
        if (ans == "YES" || ans2 == "YES") puts("YES");else puts("NO");
        // int p = j-1, q = j+1;
        // for (;p>=1, q<= n; p--, q++)
        // {
        //     if (a[p] >= a[p+1] && a[p] > 0 && a[p+1] > 0)
        //     {
        //         a[p] = a[p+1] - 1;
        //     }
        //     if (a[q] >= a[q-1] && a[q] > 0 && a[q-1] > 0)
        //     {
        //         a[q] = a[q-1]-1;
        //     }
        // }
        // p = j-1, q = j+1;
        // for (;p>=1, q<= n; p--, q++)
        // {
        //     if (a[p] >= a[p+1] || a[q] >= a[q-1])
        //     {
        //         ans = "NO"; break;
        //     }
        // }
        // cout << ans << endl;
    }

    return 0;
}


#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <assert.h>
#include <map>
#include <set>
#include <bitset>
#include <iomanip>
#include <stack>
// #include <unordered_map>
#include <cmath>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
// #define INF 0x7f7f7f7f  //2139062143
#define INF1 0x3f3f3f3f //1061109567
#define INF2 2147483647
#define llINF 9223372036854775807
#define pi 3.14159265358979323846264338327950254
#define pb push_back
#define ll long long
#define debug cout << "debug\n";
#define STDIN                      \
    freopen("in.txt", "r", stdin); \
    freopen("out.txt", "w", stdout);
#define IOS                      \
    ios::sync_with_stdio(false); \
    cin.tie(NULL);
#define scai(x) scanf("%d", &x)
#define sca2i(x, y) scanf("%d %d", &x, &y)
#define scaf(x) scanf("%lf", &x)
#define sca2f(x, y) scanf("%lf %lf", &x, &y)
#define For(m, n) for (int i = m; i < n; i++)
#define PII pair<int, int>
#define PLL pair<long, long>
#define ft first
#define sd second
#define pb push_back
#define ST(x, y, z) sort(x + y, x + z);
#define lson o << 1, l, mid
#define rson o << 1 | 1, mid + 1, r
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define ROF(i, a, b) for (int i = (a); i >= (b); i--)
#define MEM(x, v) memset(x, v, sizeof(x))
#define rep(i, a, b) for (register int i = a; i <= b; i++)
#define rrep(i, a, b) for (register int i = a; i >= b; i--)
#define PIII pair<int, PII>
#define re read()
#define case  \
    int T;    \
    cin >> T; \
    rep(_, 1, T)
// #define int ll
#define LL long long
#define int ll
inline int read()
{
    char tempt = getchar();
    int x = 0, f = 0;
    while (tempt < '0' || tempt > '9')
        f |= tempt == '-', tempt = getchar();
    while (tempt >= '0' && tempt <= '9')
        x = x * 10 + tempt - '0', tempt = getchar();
    return f ? -x : x;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

const int mod = 1e9 + 7;

const int N = 200000 + 10;

int a[N];
int b[N];
signed main()
{
    // STDIN
    case{
        int n;
        cin >> n;
        string ans = "YES";
        bool flag = false;
        rep(i,0, n-1)
        {
            cin >> a[i];
            b[i] =a[i];
            if (a[i] >= i && !flag) a[i] = i;
            else {
                flag = true;
                if (a[i] >= a[i-1]){
                    if (a[i-1] <= 0) ans = "NO";
                    else a[i] = a[i-1]-1;
                }
            }
            // cout << a[i] << " ";
        }
        // cout << endl;
        // cout<<ans<<endl;
        reverse(b, b + n);
        string ans2 = "YES";
        flag = false;
        rep(i, 0, n-1)
        {
            if (b[i] >= i && !flag) b[i] = i;
            else {
                flag = true;
                if (b[i] >= b[i-1]){
                    if (b[i-1] <= 0) ans2 = "NO";
                    else b[i] = b[i-1] - 1;
                }
            }
        }
        if (ans == "YES" || ans2 == "YES") puts("YES");else puts("NO");
    }

    return 0;
}


#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <assert.h>
#include <map>
#include <set>
#include <bitset>
#include <iomanip>
#include <stack>
// #include <unordered_map>
#include <cmath>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
// #define INF 0x7f7f7f7f  //2139062143
#define INF1 0x3f3f3f3f //1061109567
#define INF2 2147483647
#define llINF 9223372036854775807
#define pi 3.14159265358979323846264338327950254
#define pb push_back
#define ll long long
#define debug cout << "debug\n";
#define STDIN                      \
    freopen("in.txt", "r", stdin); \
    freopen("out.txt", "w", stdout);
#define IOS                      \
    ios::sync_with_stdio(false); \
    cin.tie(NULL);
#define scai(x) scanf("%d", &x)
#define sca2i(x, y) scanf("%d %d", &x, &y)
#define scaf(x) scanf("%lf", &x)
#define sca2f(x, y) scanf("%lf %lf", &x, &y)
#define For(m, n) for (int i = m; i < n; i++)
#define PII pair<int, int>
#define PLL pair<long, long>
#define ft first
#define sd second
#define pb push_back
#define ST(x, y, z) sort(x + y, x + z);
#define lson o << 1, l, mid
#define rson o << 1 | 1, mid + 1, r
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define ROF(i, a, b) for (int i = (a); i >= (b); i--)
#define MEM(x, v) memset(x, v, sizeof(x))
#define rep(i, a, b) for (register int i = a; i <= b; i++)
#define rrep(i, a, b) for (register int i = a; i >= b; i--)
#define PIII pair<int, PII>
#define re read()
#define case  \
    int T;    \
    cin >> T; \
    rep(_, 1, T)
// #define int ll
#define LL long long
#define int ll
inline int read()
{
    char tempt = getchar();
    int x = 0, f = 0;
    while (tempt < '0' || tempt > '9')
        f |= tempt == '-', tempt = getchar();
    while (tempt >= '0' && tempt <= '9')
        x = x * 10 + tempt - '0', tempt = getchar();
    return f ? -x : x;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

const int mod = 1e9 + 7;

const int N = 300000 + 10;

int a[N];
int b[N];
signed main()
{
    // STDIN
    case{
        int n;
        cin >> n;
        string ans = "YES";
        bool flag = false;
        rep(i,0, n-1)
        {
            cin >> a[i];
            b[i] =a[i];
            if (a[i] >= i && !flag) a[i] = i;
            else {
                flag = true;
                if (a[i] >= a[i-1]){
                    if (a[i-1] <= 0) ans = "NO";
                    else a[i] = a[i-1]-1;
                }
            }
            // cout << a[i] << " ";
        }
        // cout << endl;
        // cout<<ans<<endl;
        reverse(b, b + n);
        string ans2 = "YES";
        flag = false;
        rep(i, 0, n-1)
        {
            if (b[i] >= i && !flag) b[i] = i;
            else {
                flag = true;
                if (b[i] >= b[i-1]){
                    if (b[i-1] <= 0) ans2 = "NO";
                    else b[i] = b[i-1] - 1;
                }
            }
        }
        if (ans == "YES" || ans2 == "YES") puts("YES");else puts("NO");
    }

    return 0;
}


#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <assert.h>
#include <map>
#include <set>
#include <bitset>
#include <iomanip>
#include <stack>
// #include <unordered_map>
#include <cmath>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
// #define INF 0x7f7f7f7f  //2139062143
#define INF1 0x3f3f3f3f //1061109567
#define INF2 2147483647
#define llINF 9223372036854775807
#define pi 3.14159265358979323846264338327950254
#define pb push_back
#define ll long long
#define debug cout << "debug\n";
#define STDIN                      \
    freopen("in.txt", "r", stdin); \
    freopen("out.txt", "w", stdout);
#define IOS                      \
    ios::sync_with_stdio(false); \
    cin.tie(NULL);
#define scai(x) scanf("%d", &x)
#define sca2i(x, y) scanf("%d %d", &x, &y)
#define scaf(x) scanf("%lf", &x)
#define sca2f(x, y) scanf("%lf %lf", &x, &y)
#define For(m, n) for (int i = m; i < n; i++)
#define PII pair<int, int>
#define PLL pair<long, long>
#define ft first
#define sd second
#define pb push_back
#define ST(x, y, z) sort(x + y, x + z);
#define lson o << 1, l, mid
#define rson o << 1 | 1, mid + 1, r
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define ROF(i, a, b) for (int i = (a); i >= (b); i--)
#define MEM(x, v) memset(x, v, sizeof(x))
#define rep(i, a, b) for (register int i = a; i <= b; i++)
#define rrep(i, a, b) for (register int i = a; i >= b; i--)
#define PIII pair<int, PII>
#define re read()
#define case  \
    int T;    \
    cin >> T; \
    rep(_, 1, T)
// #define int ll
#define LL long long
#define int ll
inline int read()
{
    char tempt = getchar();
    int x = 0, f = 0;
    while (tempt < '0' || tempt > '9')
        f |= tempt == '-', tempt = getchar();
    while (tempt >= '0' && tempt <= '9')
        x = x * 10 + tempt - '0', tempt = getchar();
    return f ? -x : x;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

const int mod = 1e9 + 7;

const int N = 300000 + 10;

int a[N];
int b[N];
signed main()
{
    // STDIN
    case{
        int n;
        cin >> n;
        for (int i = 0; i < n; i++) cin >> a[i];

        int l = 0, r = n - 1;

        while (l<n && a[l] >= l) l++;
        while (r >=0 && a[r] >= n - r -1) r--;
        if (l - 1 >= r + 1) printf("YEs\n");
        else printf("No\n");
    }
    return 0;
}


#include <iomanip>
#include <iostream>
#include <set>
#include <map>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <queue>
#include <bitset>
#include <string>

#define ll long long
#define mp make_pair
#define pb push_back

using namespace std;

const int N = 3000010;
const int M = 2010;
const int INF = 2e9;
const int MOD = 1e6+3;

int t, n, k;
int a[N];
int minpref[N], minsuf[N];

int main() {
    scanf("%d", &t);
    while (t--) {
        scanf("%d", &n);
        for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
        minpref[1] = a[1] - 1;
        for (int i = 2; i <= n; i++) minpref[i] = min(minpref[i - 1], a[i] - i);
        minsuf[n] = a[n] + n;
        for (int i = n - 1; i >= 1; i--) minsuf[i] = min(minsuf[i + 1], a[i] + i);
        bool ok = false;
        for (int i = 1; i <= n; i++) {
            int x = min(minpref[i] + i, minsuf[i] - i);
            ok |= (x - (i - 1) >= 0 && x - (n - i) >= 0);
        }
        if (ok) printf("Yes\n");
        else printf("No\n");
    }
	return 0;
}


#include <iomanip>
#include <iostream>
#include <set>
#include <map>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <queue>
#include <bitset>
#include <string>

#define ll long long
#define mp make_pair
#define pb push_back

using namespace std;

const int N = 3000010;
const int M = 2010;
const int INF = 2e9;
const int MOD = 1e6+3;

int t, n, k;
int a[N];
int minpref[N], minsuf[N];

int main() {
    scanf("%d", &t);
    while (t--) {
        scanf("%d", &n);
        for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
        minpref[1] = a[1] - 1;
        for (int i = 2; i <= n; i++) minpref[i] = min(minpref[i - 1], a[i] - i);
        minsuf[n] = a[n] + n;
        for (int i = n - 1; i >= 1; i--) minsuf[i] = min(minsuf[i + 1], a[i] + i);
        bool ok = false;
        for (int i = 1; i <= n; i++) {
            ok |= (minpref[i] + 1 >= 0 && minsuf[i] - n >= 0);
        }
        if (ok) printf("Yes\n");
        else printf("No\n");
    }
	return 0;
}


#include <iomanip>
#include <iostream>
#include <set>
#include <map>
#include <algorithm>
#include <ctime>
#include <cstdio>
#include <cmath>
#include <queue>
#include <bitset>
#include <string>

#define ll long long
#define mp make_pair
#define pb push_back

using namespace std;

const int N = 3000010;
const int M = 2010;
const int INF = 2e9;
const int MOD = 1e6+3;

int t, n, k;
int a[N];

int main() {
    scanf("%d", &t);
    while (t--) {
        scanf("%d", &n);
        for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
        int pref = 0, suf = 0;
        int cur = 0;
        while (pref + 1 <= n && cur <= a[pref + 1]) {
            pref++;
            cur++;
        }
        cur = 0;
        suf = n + 1;
        while (suf - 1 >= 1 && cur <= a[suf - 1]) {
            suf--;
            cur++;
        }
        bool ok = (pref >= suf);
        if (ok) printf("Yes\n");
        else printf("No\n");
    }
	return 0;
}


#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>

using namespace std;

int main()
{

    int t;
    cin >> t;
    while (t--) {

        int n;
        cin >> n;
        int r = -1;
        long long int t = -1;
        vector<long long int>x(n);
        vector<bool>a(n), b(n);
        for (int i = 0; i < n; i++) {

            cin >> x[i];
            if (t < x[i]) {
                t = max(t, x[i]);
                r = i;
            }
            if (x[i] < i)a[i] = 1;
            if (x[i] < n - i - 1)b[i] = 1;
        }
        int c = n;
        for (int i = 0; i < n; i++) {
            if (a[i]) {
                c = i - 1;
                break;

            }
        }
        bool f = 0;
        for (int i = n - 1; i >= 0; i--) {
            if (b[i]) {
                if (i >= c)f = 1;
         //       cout << i;
                break;
            }
        }
       // cout << c;

        if (!f)cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;

}


#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>

using namespace std;

int main()
{

    int t;
    cin >> t;
    while (t--) {

        int n;
        cin >> n;
        int r = -1;
        long long int t = -1;
        for (int i = 0; i < n; i++) {
            long long int x;
            cin >> x;
            if (t < x) {
                t = max(t, x);
                r = i;
            }
        }
        long long int d = max(r ,n-r-1);
       // cout << t << " " << d ;
        if (d  <= t)cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;

}


#include <iostream>
#include <vector>

using namespace std;

int main() {
  int t;
  cin >> t;
  for(int i = 0; i < t; ++i) {
    long long int n;
    cin >> n;
    vector<int> vec;
    int x;
    for(long long int j = 0; j < n; ++j) {
      cin >> x;
      vec.push_back(x);
    }
    long long int mid = n / 2;

    if(n % 2 != 0) {
      int k = 0;
      for(long long int j = 0; j <= mid; ++j) {
        if(vec[j] < j) {
          k = 1;
          break;
        }
      }
      for(long long int j = mid + 1; j < n; ++j) {
        if(vec[j] < n - j - 1) {
          k = 1;
          break;
        }
      }

      if(k == 1)
        cout << "NO\n";
      else
        cout << "YES\n";

    }

    else {
      int k = 0, l = 0;

      for(long long int j = 0; j < mid; ++j) {
        if(vec[j] < j) {
          k = 1;
          break;
        }
      }

      for(long long int j = mid; j < n; ++j) {
        if(vec[j] < n - j) {
          k = 1;
          break;
        }
      }

        for(long long int j = 0; j < mid; ++j) {
          if(vec[j] < j + 1) {
            l = 1;
            break;
          }
        }

        for(long long int j = mid; j < n; ++j) {
          if(vec[j] < n - j - 1) {
            l = 1;
            break;
          }
        }

      if(k == 1 && l == 1)
        cout << "NO\n";
      else
        cout << "YES\n";

    }

  }
  return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
  int t;
  cin >> t;
  for(int i = 0; i < t; ++i) {
    long long int n;
    cin >> n;
    vector<int> vec;
    int x;
    for(long long int j = 0; j < n; ++j) {
      cin >> x;
      vec.push_back(x);
    }
    int k = 0;
    while(vec[k] >= k)
      ++k;

    int j = n - 1;
    int p = 0;
    while(vec[j] >= n - j - 1) {
      j--;
      p++;
    }

    if(k + p <= n)
      cout << "NO\n";
    else
      cout << "Yes\n";

  }
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<math.h>
#include<string.h>
#include <queue>
#include<map>
using namespace std;
int a[300001],b[300001];
int main()
{
	int t, n;
	scanf("%d", &t);
	while (t--)
	{
		int f = 0;
		memset(b, 0, sizeof b);
		scanf("%d", &n);
		for (int i = 0; i < n; i++)
			scanf("%d", &a[i]);
		for (int i = 0; i < n; i++)
		{
			if (a[i] >= i)
				b[i] = 1;
			if (a[i] >= n - i - 1)
				b[i] += 10;
		}
		int i;
		for ( i = 0; i < n; i++)
		{
			if (b[i] == 0)
				break;
		}
		if (i < n)
			printf("No\n");
		else
		{
			for ( i = 0; i < n; i++)
				if (b[i] == 10)
					break;
			if (i && b[i - 1] == 1 && b[i] == 10)
			{
				printf("No\n");
				continue;
			}
			for (; i < n; i++)
				if (b[i] == 1)
					break;
			if (i < n)
				printf("No\n");
			else
				printf("Yes\n");
		}
	}
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <list>
#define ll long long
using namespace std;

int arr[300001];
int main()
{
	int T;
	cin >> T;

	for (int t = 0; t < T; t++) {
		int n;

		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
		}

		int incrIdex = 0, decrIdex = 0;

		for (int i = 0; i < n; i++) {
			if (arr[i] >= i) {
				incrIdex = i;
			}
			else break;
		}
		for (int i = 0; i < n; i++) {
			if (arr[n - 1 - i] >= i) {
				decrIdex = n-1-i;
			}
			else break;
		}

		if (decrIdex <= incrIdex) {
			cout << "Yes" << endl;
		}
		else cout << "No" << endl;
	}
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	int t, j = -1;
	cin >> t;
	while (++j < t) {
		long n;
		cin >> n;
		vector < long > a(n);
		int i = -1;
		while (++i < n)
			cin >> a[i];
		i = -1;
		int p=-1, s=n;
		while (++i < n) {
			if (a[i] < i)
				break;
			p = i;
		}
		i = n;
		while (--i >= 0) {
			if (a[i] < n - i - 1)
				break;
			s = i;
		}
		if (p >= s)
			cout << "YES"<<endl;
		else cout << "NO" << endl;
	}
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	int t, j = -1;
	cin >> t;
	while (++j < t) {
		long n;
		cin >> n;
		vector < long > a(n);
		int i = -1;
		while (++i < n)
			cin >> a[i];
		i = -1;
		int f = 1;
		while (++i < n && f)
			if (i < a[i] +1 && n - i-1 < a[i] + 1) {
				cout << "YES"<<endl;
				f = 0;
			}
		if (f)
			cout << "NO" << endl;
	}
}


//#pragma optimization_level 3
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <stack>
#include <iomanip>
#include <cmath>
#include <functional>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <ctime>
#include <chrono>
#include <climits>
#define mp make_pair
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define pb(x) push_back(x);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define MOD 998244353  //(1000*1000*1000+7)
#define inf1 2e9
#define inf2 2e18

vector<vector<long long> > one(int sz) {
	vector<vector<long long> > ret;
	ret.resize(sz);
	for (int i = 0; i < ret.size(); i++) {
		ret[i].resize(sz);
		for (int j = 0; j < ret.size(); j++) {
			ret[i][j] = (i == j);
		}
	}
	return ret;
}

vector<vector<long long> > mult(vector<vector<long long> > a, vector<vector<long long> > b) {
	vector<vector<long long > > ret;
	ret.resize(a.size());
	for (int i = 0; i < ret.size(); i++) {
		ret[i].resize(a.size());
		for (int j = 0; j < ret.size(); j++) {
			ret[i][j] = 0;
		}
	}
	for (int k = 0; k < ret.size(); k++) {
		for (int i = 0; i < a.size(); i++) {
			for (int j = 0; j < b.size(); j++) {
				ret[i][j] = (ret[i][j] + a[i][k] * b[k][j]);
				ret[i][j] %= MOD;
			}
		}
	}
	return ret;
}

vector<vector<long long> > pw(vector<vector<long long> > a, long long b) {
	if (b == 0)
		return one((int)a.size());
	if (b % 2)
		return mult(a, pw(a, b - 1));
	return pw(mult(a, a), b / 2);
}

inline int mul(int a, int b) {
	return int(a * 1ll * b % MOD);
}

inline int norm(int a) {
	if (a >= MOD)
		a -= MOD;
	if (a < 0)
		a += MOD;
	return a;
}

inline int binPow(int a, int k) {
	int ans = 1;
	while (k > 0) {
		if (k & 1)
			ans = mul(ans, a);
		a = mul(a, a);
		k >>= 1;
	}
	return ans;
}

inline int subtract(int a, int b) {
	return norm(a - b);
}

inline int sum(int a, int b) {
	return int((a + b) % MOD);
}

inline int inv(int a) {
	return binPow(a, MOD - 2);
}

ll gcd(ll a, ll b) {
	if (a == 0)return b;
	return gcd(b % a, a);
}

ll lcm(ll a, ll b) {
	return (a * b) / gcd(a, b);
}

int getbit(int mask, int bit) {
	return (mask >> bit) & 1;
}

void setbit(int& mask, int bit) {
	mask = (mask | (1 << bit));
}

void offbit(int& mask, int bit) {
	mask = mask & (~(1 << bit));
}

int count(int X)
{
	X = X - ((X >> 1) & 0x55555555);
	X = (X & 0x33333333) + ((X >> 2) & 0x33333333);
	X = (X + (X >> 4)) & 0x0F0F0F0F;
	X = X + (X >> 8);
	X = X + (X >> 16);
	return (X & 0x0000003F);
}

int main() {
	srand(chrono::system_clock::now().time_since_epoch().count());
	cin.sync_with_stdio(false);
	cin.tie(false);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int t;
	cin >> t;
	for (int tt = 0; tt < t; tt++) {

		int n;
		cin >> n;
		vector<int>a(n);
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}

		vector<int>b = a;

		int ok = 1;
		b[0] = 0;
		int goup = 1;
		for (int i = 1; i < n; i++) {
			if (goup && b[i] >= b[i - 1] + 1) {
				b[i] = b[i - 1] + 1;
			}
			else if (!goup && b[i - 1] - 1 >=0) {
				b[i] = min(b[i - 1] - 1, b[i]);
			}
			else if (goup) {
				goup = 0;
				i--;
			}
			else {
				ok = 0;
				break;
			}
		}
		if (ok) {
			cout << "Yes\n";
		}
		else {
			ok = 1;
			b = a;
			goup = 0;
			for (int i = 1; i < n; i++) {
				if (goup && b[i] >= b[i - 1] + 1) {
					b[i] = b[i - 1] + 1;
				}
				else if (!goup && b[i - 1] - 1 >= 0) {
					b[i] = min(b[i - 1] - 1, b[i]);
				}
				else if (goup) {
					goup = 0;
					i--;
				}
				else {
					ok = 0;
					break;
				}
			}
			if (ok) {
				cout << "Yes\n";
			}
			else {
				cout << "No\n";
			}

		}

	}

	return 0;
}


//#pragma optimization_level 3
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <stack>
#include <iomanip>
#include <cmath>
#include <functional>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <ctime>
#include <chrono>
#include <climits>
#define mp make_pair
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define pb(x) push_back(x);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define MOD 998244353  //(1000*1000*1000+7)
#define inf1 2e9
#define inf2 2e18

vector<vector<long long> > one(int sz) {
	vector<vector<long long> > ret;
	ret.resize(sz);
	for (int i = 0; i < ret.size(); i++) {
		ret[i].resize(sz);
		for (int j = 0; j < ret.size(); j++) {
			ret[i][j] = (i == j);
		}
	}
	return ret;
}

vector<vector<long long> > mult(vector<vector<long long> > a, vector<vector<long long> > b) {
	vector<vector<long long > > ret;
	ret.resize(a.size());
	for (int i = 0; i < ret.size(); i++) {
		ret[i].resize(a.size());
		for (int j = 0; j < ret.size(); j++) {
			ret[i][j] = 0;
		}
	}
	for (int k = 0; k < ret.size(); k++) {
		for (int i = 0; i < a.size(); i++) {
			for (int j = 0; j < b.size(); j++) {
				ret[i][j] = (ret[i][j] + a[i][k] * b[k][j]);
				ret[i][j] %= MOD;
			}
		}
	}
	return ret;
}

vector<vector<long long> > pw(vector<vector<long long> > a, long long b) {
	if (b == 0)
		return one((int)a.size());
	if (b % 2)
		return mult(a, pw(a, b - 1));
	return pw(mult(a, a), b / 2);
}

inline int mul(int a, int b) {
	return int(a * 1ll * b % MOD);
}

inline int norm(int a) {
	if (a >= MOD)
		a -= MOD;
	if (a < 0)
		a += MOD;
	return a;
}

inline int binPow(int a, int k) {
	int ans = 1;
	while (k > 0) {
		if (k & 1)
			ans = mul(ans, a);
		a = mul(a, a);
		k >>= 1;
	}
	return ans;
}

inline int subtract(int a, int b) {
	return norm(a - b);
}

inline int sum(int a, int b) {
	return int((a + b) % MOD);
}

inline int inv(int a) {
	return binPow(a, MOD - 2);
}

ll gcd(ll a, ll b) {
	if (a == 0)return b;
	return gcd(b % a, a);
}

ll lcm(ll a, ll b) {
	return (a * b) / gcd(a, b);
}

int getbit(int mask, int bit) {
	return (mask >> bit) & 1;
}

void setbit(int& mask, int bit) {
	mask = (mask | (1 << bit));
}

void offbit(int& mask, int bit) {
	mask = mask & (~(1 << bit));
}

int count(int X)
{
	X = X - ((X >> 1) & 0x55555555);
	X = (X & 0x33333333) + ((X >> 2) & 0x33333333);
	X = (X + (X >> 4)) & 0x0F0F0F0F;
	X = X + (X >> 8);
	X = X + (X >> 16);
	return (X & 0x0000003F);
}

int main() {
	srand(chrono::system_clock::now().time_since_epoch().count());
	cin.sync_with_stdio(false);
	cin.tie(false);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	int t;
	cin >> t;
	for (int tt = 0; tt < t; tt++) {

		int n;
		cin >> n;
		vector<int>a(n);
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}

		vector<int>b = a;
		int r = 0;
		int ok = 1;
		for (int i = 0; i < n; i++) {
			if (a[i] >= i && r == 0) {
				if (i > 0)a[i - 1] = i - 1;
			}
			if (a[i] < i && r == 0) {
				a[i] = min(a[i], a[i - 1] - 1);
				r = 1;
			}
			if (a[i] < n - i - 1 && r == 1) {
				ok = 0;
				break;
			}

		}
		if (!ok) {
			cout << "No\n";
		}
		else {
			cout << "Yes\n";
		}

	}

	return 0;
}


#include<stdio.h>
int a[300000 + 10];
int main()
{
	int n;
	scanf("%d",&n);
	for (int k = 0; k < n; k++)
	{
		int m;
		int mid;
		scanf("%d", &m);
		int flag = 1;
		if (m % 2)
		{
			mid = m / 2;
			for (int i = 0; i < m; i++)
			{
				scanf("%d", &a[i]);
				if (i < mid)
				{
					if (a[i] < i)
					{
						flag = 0;
						break;
					}
				}
				else  if (i > mid)
				{
					if (a[i] < (m - i - 1))
					{
						flag = 0;
						break;
					}
				}
			}
			if (a[mid] < mid)
			{
				flag = 0;
			}
		}
		else
		{
			mid = m / 2 - 1;
			for (int i = 0; i < m; i++)
			{
				scanf("%d", &a[i]);
				if (i < mid)
				{
					if (a[i] < i)
					{
						flag = 0;
						break;
					}
				}
				else  if (i > mid + 1)
				{
					if (a[i] < (m - i - 1))
					{
						flag = 0;
						break;
					}
				}
			}
			if (a[mid] >= mid && a[mid + 1] >= mid)
			{
				if (a[mid] == a[mid + 1] && a[mid] == mid) flag = 0;
			}
			else flag = 0;
		}
		if (m == 1)
		{
			printf("Yes\n");
			continue;
		}
		if (flag) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}


#include<stdio.h>
int a[300000 + 10];
int main()
{
	int n;
	scanf("%d",&n);
	for (int k = 0; k < n; k++)
	{
		int m;
		int mid;
		scanf("%d", &m);
		int flag = 1;
		if (m % 2)
		{
			mid = m / 2;
			for (int i = 0; i < m; i++)
			{
				scanf("%d", &a[i]);
				if (i <= mid)
				{
					if (a[i] < i)
					{
						flag = 0;
					}
				}
				else  if (i > mid)
				{
					if (a[i] < (m - i - 1))
					{
						flag = 0;
					}
				}
			}
		}
		else
		{
			mid = m / 2 - 1;
			for (int i = 0; i < m; i++)
			{
				scanf("%d", &a[i]);
				if (i < mid)
				{
					if (a[i] < i)
					{
						flag = 0;
					}
				}
				else  if (i > mid + 1)
				{
					if (a[i] < (m - i - 1))
					{
						flag = 0;
					}
				}
			}
			if (a[mid] >= mid && a[mid + 1] >= mid)
			{
				if (a[mid] == a[mid + 1] && a[mid] == mid) flag = 0;
			}
			else flag = 0;
		}
		if (flag) printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}


#include<iostream>
#include<string.h>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<map>
using namespace std;
const int maxl=300000+10;
int a[maxl];
int main()
{
   int t,n;
   cin>>t;
   while(t--)
   {
       cin>>n;
       for(int i=0;i<n;i++)
        cin>>a[i];
       int flag=0;
       int i=0;
       for(;i<n;i++)
       {
           if(a[i]>=i) continue;
           break;
       }
       if(i<n)
       {
           if(a[i]==a[i-1]&&a[i]<n-i)
            flag=1;
       }
       for(;i<n;i++)
       {
           if(a[i]>=n-i-1) continue;
           else
           {
               flag=1;
               break;
           }
       }
       if(flag) cout<<"No"<<endl;
       else cout<<"Yes"<<endl;
   }
    return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
#include<ctime>
#include<math.h>
#include<fstream>
#include<stdio.h>
#include<stack>
#include<limits.h>
#include<iomanip>  // cout << setprecision(...) <<  fixed;
using namespace std;

#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define pii pair<int, int>
#define pllll pair<ll, ll>
#define psll pair<string, ll>
#define qi queue<int>
#define qll queue<ll>
#define si set<int>
#define sll set<ll>
#define mulsi multiset<int>
#define mulsll multiset<ll>
#define mulss multiset<string>
#define msi map<string, int>
#define mii map<int, int>
#define ci const int
#define cll const ll
#define cld const long double
#define msii multiset<int> :: iterator
#define mslli multiset<ll> :: iterator
#define sii set<int> :: iterator
#define slli set<ll> :: iterator
#define fi first
#define se second
#define pb push_back

ll gcd(ll a, ll b) {
	while (a != b) {
		if (b > a) {

			b -= a;
		}
		else {
			a -= b;
		}
	}
	return a;
}

ll n = 0, m = 0, t = 0, k = 0, otv = 0, e = 0, tests = 0, r = 0;
const ll maxn = 1 * 1e5 + 3;
multiset<ll> st;
int flag = 0;
ll a[maxn];

int main() {
 	//freopen("network.in", "r", stdin);
 	//freopen("network.out", "w", stdout);
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);
	cout.tie(0);
	string s;
	cin >> t;
	ll y = 0;
	for (int i = 0; i < t; i++) {
		cin >> n;
		y = 0; r = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		if (n == 1) {
			cout << "Yes";
		}
		else if (n == 2) {
			if (a[0] != 0 || a[1] != 0) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		else {
			if (n % 2 == 0) {
				k = (n) / 2;
			}
			else {
				k = (n - 1) / 2;
			}
			for (int i = 0; i <= k; i++) {
				if(a[i] >= i){
					y++;
				}
			}
			for (int i = k + 1; i < n; i++) {
				if (a[i] >= (n - i - 1)) {
					y++;
				}
			}
			for (int i = 0; i < k; i++) {
				if (a[i] >= i + n % 2) {
					r++;
				}
			}
			for (int i = k; i < n; i++) {
				if (a[i] >= (n - i - 1)) {
					r++;
				}
			}
			if (r == n || y == n) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		cout << endl;
	}

//	system("pause");
}


#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
#include<ctime>
#include<math.h>
#include<fstream>
#include<stdio.h>
#include<stack>
#include<limits.h>
#include<iomanip>  // cout << setprecision(...) <<  fixed;
using namespace std;

#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define pii pair<int, int>
#define pllll pair<ll, ll>
#define psll pair<string, ll>
#define qi queue<int>
#define qll queue<ll>
#define si set<int>
#define sll set<ll>
#define mulsi multiset<int>
#define mulsll multiset<ll>
#define mulss multiset<string>
#define msi map<string, int>
#define mii map<int, int>
#define ci const int
#define cll const ll
#define cld const long double
#define msii multiset<int> :: iterator
#define mslli multiset<ll> :: iterator
#define sii set<int> :: iterator
#define slli set<ll> :: iterator
#define fi first
#define se second
#define pb push_back

ll gcd(ll a, ll b) {
	while (a != b) {
		if (b > a) {

			b -= a;
		}
		else {
			a -= b;
		}
	}
	return a;
}

ll n = 0, m = 0, t = 0, k = 0, otv = 0, e = 0, tests = 0, r = 0;
const ll maxn = 3 * 1e6 + 3;
multiset<ll> st;
int flag = 0;
ll a[maxn];

int main() {
 	//freopen("network.in", "r", stdin);
 	//freopen("network.out", "w", stdout);
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);
	cout.tie(0);
	cin >> t;
	ll y = 0;
	for (int i = 0; i < t; i++) {
		cin >> n;
		y = 0; r = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		if (n == 1) {
			cout << "Yes";
		}
		else if (n == 2) {
			if (a[0] != 0 || a[1] != 0) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		else {
			if (n % 2 == 0) {
				k = (n) / 2;
				for (int i = 0; i <= k; i++) {
					if (a[i] >= i) {
						y++;
					}
				}
				for (int i = k + 1; i < n; i++) {
					if (a[i] >= n - i - 1) {
						y++;
					}
				}
				for (int i = 0; i < k - 1; i++) {
					if (a[i] >= i) {
						r++;
					}
				}
				for (int i = k - 1; i < n; i++) {
					if (a[i] >= n - i - 1) {
						r++;
					}
				}
				if (r == n || y == n) {
					cout << "Yes";
				}
				else {
					cout << "No";
				}
			}
			else {
				k = (n - 1) / 2;
				for (int i = 0; i <= k; i++) {
					if (a[i] >= i) {
						y++;
					}
				}
				for (int i = k + 1; i < n; i++) {
					if (a[i] >= n - i - 1) {
						y++;
					}
				}
				if (y == n) {
					cout << "Yes";
				}
				else {
					cout << "No";
				}
			}
		}
		cout << endl;
	}
//	system("pause");
}


#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
#include<ctime>
#include<math.h>
#include<fstream>
#include<stdio.h>
#include<stack>
#include<limits.h>
#include<iomanip>  // cout << setprecision(...) <<  fixed;
using namespace std;

#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define pii pair<int, int>
#define pllll pair<ll, ll>
#define psll pair<string, ll>
#define qi queue<int>
#define qll queue<ll>
#define si set<int>
#define sll set<ll>
#define mulsi multiset<int>
#define mulsll multiset<ll>
#define mulss multiset<string>
#define msi map<string, int>
#define mii map<int, int>
#define ci const int
#define cll const ll
#define cld const long double
#define msii multiset<int> :: iterator
#define mslli multiset<ll> :: iterator
#define sii set<int> :: iterator
#define slli set<ll> :: iterator
#define fi first
#define se second
#define pb push_back

ll gcd(ll a, ll b) {
	while (a != b) {
		if (b > a) {

			b -= a;
		}
		else {
			a -= b;
		}
	}
	return a;
}

ll n = 0, m = 0, t = 0, k = 0, otv = 0, e = 0, tests = 0, r = 0;
const ll maxn = 1 * 1e5 + 3;
multiset<ll> st;
int flag = 0;
ll a[maxn];

int main() {
 	//freopen("network.in", "r", stdin);
 	//freopen("network.out", "w", stdout);
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);
	cout.tie(0);
	string s;
	cin >> t;
	ll y = 0;
	for (int i = 0; i < t; i++) {
		cin >> n;
		y = 0; r = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		if (n == 1) {
			cout << "Yes";
		}
		else if (n == 2) {
			if (a[0] != 0 || a[1] != 0) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		else {
			if (n % 2 == 0) {
				k = n / 2;
			}
			else {
				k = (n - 1) / 2;
			}
			for (int i = 0; i <= k; i++) {
				if(a[i] >= i){
					y++;
				}
			}
			for (int i = k + 1; i < n; i++) {
				if (a[i] >= (n - i)) {
					y++;
				}
			}
			for (int i = 0; i < k; i++) {
				if (a[i] >= i + 1) {
					r++;
				}
			}
			for (int i = k; i < n; i++) {
				if (a[i] >= (n - i)) {
					r++;
				}
			}
			if (r == n || y == n) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		cout << endl;
	}

//	system("pause");
}


#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
#include<ctime>
#include<math.h>
#include<fstream>
#include<stdio.h>
#include<stack>
#include<limits.h>
#include<iomanip>  // cout << setprecision(...) <<  fixed;
using namespace std;

#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define pii pair<int, int>
#define pllll pair<ll, ll>
#define psll pair<string, ll>
#define qi queue<int>
#define qll queue<ll>
#define si set<int>
#define sll set<ll>
#define mulsi multiset<int>
#define mulsll multiset<ll>
#define mulss multiset<string>
#define msi map<string, int>
#define mii map<int, int>
#define ci const int
#define cll const ll
#define cld const long double
#define msii multiset<int> :: iterator
#define mslli multiset<ll> :: iterator
#define sii set<int> :: iterator
#define slli set<ll> :: iterator
#define fi first
#define se second
#define pb push_back

ll gcd(ll a, ll b) {
	while (a != b) {
		if (b > a) {

			b -= a;
		}
		else {
			a -= b;
		}
	}
	return a;
}

ll n = 0, m = 0, t = 0, k = 0, otv = 0, e = 0, tests = 0, r = 0;
const ll maxn = 1 * 1e5 + 3;
multiset<ll> st;
int flag = 0;
ll a[maxn];

int main() {
 	//freopen("network.in", "r", stdin);
 	//freopen("network.out", "w", stdout);
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);
	cout.tie(0);
	string s;
	cin >> t;
	ll y = 0;
	for (int i = 0; i < t; i++) {
		cin >> n;
		y = 0; r = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		if (n == 1) {
			cout << "Yes";
		}
		else if (n == 2) {
			if (a[0] != 0 || a[1] != 0) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		else {
			for (int i = 0; i <= n / 2; i++) {
				if(a[i] >= i){
					y++;
				}
			}
			for (int i = n/2 + 1; i < n; i++) {
				if (a[i] >= (n - i - 1)) {
					y++;
				}
			}
			for (int i = 0; i < n / 2; i++) {
				if (a[i] >= i) {
					r++;
				}
			}
			for (int i = n / 2; i < n; i++) {
				if (a[i] >= (n - i)) {
					r++;
				}
			}
			if (r == n || y == n) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		cout << endl;
	}

//	system("pause");
}


#include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdlib.h>
#include<ctime>
#include<math.h>
#include<fstream>
#include<stdio.h>
#include<stack>
#include<limits.h>
#include<iomanip>  // cout << setprecision(...) <<  fixed;
using namespace std;

#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define pii pair<int, int>
#define pllll pair<ll, ll>
#define psll pair<string, ll>
#define qi queue<int>
#define qll queue<ll>
#define si set<int>
#define sll set<ll>
#define mulsi multiset<int>
#define mulsll multiset<ll>
#define mulss multiset<string>
#define msi map<string, int>
#define mii map<int, int>
#define ci const int
#define cll const ll
#define cld const long double
#define msii multiset<int> :: iterator
#define mslli multiset<ll> :: iterator
#define sii set<int> :: iterator
#define slli set<ll> :: iterator
#define fi first
#define se second
#define pb push_back

ll gcd(ll a, ll b) {
	while (a != b) {
		if (b > a) {

			b -= a;
		}
		else {
			a -= b;
		}
	}
	return a;
}

ll n = 0, m = 0, t = 0, k = 0, otv = 0, e = 0, tests = 0, r = 0;
const ll maxn = 1 * 1e5 + 3;
multiset<ll> st;
int flag = 0;
ll a[maxn];

int main() {
 	//freopen("network.in", "r", stdin);
 	//freopen("network.out", "w", stdout);
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);
	cout.tie(0);
	cin >> t;
	ll y = 0;
	for (int i = 0; i < t; i++) {
		cin >> n;
		y = 0; r = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		if (n == 1) {
			cout << "Yes";
		}
		else if (n == 2) {
			if (a[0] != 0 || a[1] != 0) {
				cout << "Yes";
			}
			else {
				cout << "No";
			}
		}
		else {
			if (n % 2 == 0) {
				k = (n) / 2;
				for (int i = 0; i <= k; i++) {
					if (a[i] >= i) {
						y++;
					}
				}
				for (int i = k + 1; i < n; i++) {
					if (a[i] >= n - i - 1) {
						y++;
					}
				}
				for (int i = 0; i < k - 1; i++) {
					if (a[i] >= i) {
						r++;
					}
				}
				for (int i = k - 1; i < n; i++) {
					if (a[i] >= n - i - 1) {
						r++;
					}
				}
				if (r == n || y == n) {
					cout << "Yes";
				}
				else {
					cout << "No";
				}
			}
			else {
				k = (n - 1) / 2;
				for (int i = 0; i <= k; i++) {
					if (a[i] >= i) {
						y++;
					}
				}
				for (int i = k + 1; i < n; i++) {
					if (a[i] >= n - i - 1) {
						y++;
					}
				}
				if (y == n) {
					cout << "Yes";
				}
				else {
					cout << "No";
				}
			}
		}
		cout << endl;
	}
//	system("pause");
}