You stand on cell 0 of a straight track of n cells. Cell i holds a non-negative integer a[i]: from cell i you may jump forward to any cell in the range i+1 through i+a[i] (not past the end of the track). A value of 0 means you cannot move from that cell.
Decide whether you can reach the last cell, index n-1.
Input format
Line 1: an integer n.
Line 2: n space-separated non-negative integers a[0..n-1] (present whenever n >= 1).
Output format
Print YES if the last cell is reachable from cell 0, otherwise NO.
Constraints
- 1 <= n <= 100000
- 0 <= a[i] <= 100000