package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
)

//•*¨*•.¸¸♪I/O•*¨*•.¸¸♪

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

func scanInt() int {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return a
}

func scanInt64() int64 {
	sc.Scan()
	a,_ := strconv.ParseInt(sc.Text(),10,64)
	return a
}

func scanFloat64() float64 {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return float64(a)
}

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ { res[i] = scanInt() }
	return res
}

func scanText() string {
	sc.Scan()
	return sc.Text()
}

func printInts(a ...int) {
	for i, e := range a {
		fmt.Fprint(wr, e)
		if i != len(a)-1 { fmt.Fprint(wr, " ") }
	}
	fmt.Fprintln(wr)
	wr.Flush()
}

//•*¨*•.¸¸♪Main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)

func main() {
	sc.Split(bufio.ScanWords)
	// sc.Buffer(make([]byte, 10000), 100000000)

	in := scanInt()

	for t := 0; t < in; t++ {
		n := scanInt()
		a := scanInts(n)

		f := true
		dec := false
		for i := 0; i < n; i++ {
			if !dec {
				if a[i] < i {
					dec = true
					if i!=0 && a[i-1] == n-1-i {
						f = false
					}
				}
			}

			if dec {
				if a[i] < n-1-i {
					f = false
				}
			}
		}

		if f {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func run(_r io.Reader, _w io.Writer) {

	maxs := func(vals []int) int {
		ans := vals[0]
		for _, val := range vals[1:] {
			if val > ans {
				ans = val
			}
		}
		return ans
	}
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func() (ans bool) {
		var n int
		Fscan(in, &n)

		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		if n == 1 {
			return true
		}
		mx := maxs(a)
		if mx == 0 {
			return
		}

		// 除了两边中间不能有 0

		isDesc := false
		top := 0
		//topI := 0
		for i, v := range a {
			if !isDesc && v>=i {
				top = v
				//topI = i

			} else {
				isDesc = true
				if top - 1<v {
					v = top-1
					if v < 0 {
						return
					}
				}
				top = v
			}

		}

		//var L,R int
		//for i, v := range a {
		//	if v == mx {
		//		L = i
		//		break
		//	}
		//}
		//for i := len(a) - 1; i >= 0; i-- {
		//	if a[i] == mx {
		//		R = i
		//		break
		//	}
		//}
		//for i :=0;i<L ;i++ {
		//
		//}

		return true
	}

	var t int
	Fscan(in, &t)
	for _case := 1; _case <= t; _case++ {
		//if _case == 4{
		//	println()
		//}
		_ans := solve()
		Fprintln(out, map[bool]string{true: "Yes", false: "No"} [_ans])
	}
}

func main() { run(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscanf(reader, "%d\n", &t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Fscanf(reader, "%d\n", &n)
		vals := make([]int, n)
		for j := 0; j < n; j++ {
			fmt.Fscanf(reader, "%d", &vals[j])
		}
		fmt.Fscanf(reader, "\n")
		fmt.Fprintf(writer, "%s\n", canSharpen(vals))
	}

	writer.Flush()
}

func canSharpen(vals []int) string {
	n := len(vals)

	if n == 1 {
		return "Yes"
	}

	pre := make([]bool, n)
	pre[0] = true
	for i := 1; i < n; i++ {
		pre[i] = pre[i-1] && vals[i] >= i
	}

	suf := make([]bool, n)
	suf[n-1] = true
	for i := n - 2; i >= 0; i-- {
		suf[i] = suf[i+1] && vals[i] >= (n-i-1)
	}

	for i := 0; i < n; i++ {
		if pre[i] && suf[i] {
			return "Yes"
		}
	}

	return "No"
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}

package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
)

//•*¨*•.¸¸♪I/O•*¨*•.¸¸♪

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

func scanInt() int {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return a
}

func scanInt64() int64 {
	sc.Scan()
	a,_ := strconv.ParseInt(sc.Text(),10,64)
	return a
}

func scanFloat64() float64 {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return float64(a)
}

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ { res[i] = scanInt() }
	return res
}

func scanText() string {
	sc.Scan()
	return sc.Text()
}

func printInts(a ...int) {
	for i, e := range a {
		fmt.Fprint(wr, e)
		if i != len(a)-1 { fmt.Fprint(wr, " ") }
	}
	fmt.Fprintln(wr)
	wr.Flush()
}

//•*¨*•.¸¸♪Main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)

func main() {
	sc.Split(bufio.ScanWords)
	// sc.Buffer(make([]byte, 10000), 100000000)

	in := scanInt()

	for t := 0; t < in; t++ {
		n := scanInt()
		a := scanInts(n)

		f1 := true
		dec := false
		c := 0
		for i := 0; i < n; i++ {
			if !dec {
				if a[i] < c {
					dec = true
					c -= 2
					if a[i] < c || c < 0 {
						f1 = false
					}
					c--
				} else {
					c++
				}
			} else {
				if a[i] < c || c < 0 {
					f1 = false
				}
				c--
			}
		}

		f2 := true
		dec = false
		c = 0
		for i := n-1; i >= 0; i-- {
			if !dec {
				if a[i] < c {
					dec = true
					c -= 2
					if a[i] < c || c < 0 {
						f2 = false
					}
					c--
				} else {
					c++
				}
			} else {
				if a[i] < c || c < 0 {
					f2 = false
				}
				c--
			}
		}

		if f1 || f2 {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func run(_r io.Reader, _w io.Writer) {

	maxs := func(vals []int) int {
		ans := vals[0]
		for _, val := range vals[1:] {
			if val > ans {
				ans = val
			}
		}
		return ans
	}
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func() (ans bool) {
		var n int
		Fscan(in, &n)

		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		if n == 1 {
			return true
		}
		mx := maxs(a)
		if mx == 0 {
			return
		}

		// 除了两边中间不能有 0

		isDesc := false
		top := 0
		topI := 0
		for i, v := range a {
			if !isDesc && v>=i {
				top = v
				topI = i
			} else {
				isDesc = true
				if top - (i-topI)<v {
					return
				}
				top = v
				topI = i
			}

		}

		//var L,R int
		//for i, v := range a {
		//	if v == mx {
		//		L = i
		//		break
		//	}
		//}
		//for i := len(a) - 1; i >= 0; i-- {
		//	if a[i] == mx {
		//		R = i
		//		break
		//	}
		//}
		//for i :=0;i<L ;i++ {
		//
		//}

		return true
	}

	var t int
	Fscan(in, &t)
	for _case := 1; _case <= t; _case++ {
		_ans := solve()
		Fprintln(out, map[bool]string{true: "Yes", false: "No"} [_ans])
	}
}

func main() { run(os.Stdin, os.Stdout) }