A line of n boulders is numbered 0 to n-1. Standing on boulder i, a hiker can leap forward to any boulder j with i < j <= i + a_i, where a_i is the maximum leap distance printed on boulder i (a hiker never leaps backward or off the end of the line). Starting on boulder 0, determine whether the hiker can reach boulder n-1.
Input format
Line 1: an integer n.
Line 2: n space-separated integers a_0 a_1 ... a_{n-1}.
Output format
Print YES if boulder n-1 is reachable from boulder 0, otherwise print NO.
Constraints
- 1 <= n <= 40
- 0 <= a_i <= 40