New Year is coming in Line World! In this world, there are *n* cells numbered by integers from 1 to *n*, as a 1 × *n* board. People live in cells. However, it was hard to move between distinct cells, because of the difficulty of escaping the cell. People wanted to meet people who live in other cells.

So, user tncks0121 has made a transportation system to move between these cells, to celebrate the New Year. First, he thought of *n* - 1 positive integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n* - 1</sub>. For every integer *i* where 1 ≤ *i* ≤ *n* - 1 the condition 1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ *n* - *i* holds. Next, he made *n* - 1 portals, numbered by integers from 1 to *n* - 1. The *i*-th (1 ≤ *i* ≤ *n* - 1) portal connects cell *i* and cell (*i* + *a*<sub class="lower-index">*i*</sub>), and one can travel from cell *i* to cell (*i* + *a*<sub class="lower-index">*i*</sub>) using the *i*-th portal. Unfortunately, one cannot use the portal backwards, which means one cannot move from cell (*i* + *a*<sub class="lower-index">*i*</sub>) to cell *i* using the *i*-th portal. It is easy to see that because of condition 1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ *n* - *i* one can't leave the Line World using portals.

Currently, I am standing at cell 1, and I want to go to cell *t*. However, I don't know whether it is possible to go there. Please determine whether I can go to cell *t* by only using the construted transportation system.
The first line contains two space-separated integers *n* (3 ≤ *n* ≤ 3 × 10<sup class="upper-index">4</sup>) and *t* (2 ≤ *t* ≤ *n*) — the number of cells, and the index of the cell which I want to go to.

The second line contains *n* - 1 space-separated integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n* - 1</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ *n* - *i*). It is guaranteed, that using the given transportation system, one cannot leave the Line World.

from collections import defaultdict


class Graph:

    # Constructor
    def __init__(self):

        # default dictionary to store graph
        self.graph = defaultdict(list)

    # function to add an edge to graph
    def addEdge(self, u, v):
        self.graph[u].append(v)
        # self.graph[v].append(u)

    # A function used by DFS
    def DFSUtil(self, u, v, visited):

        # Mark the current node as visited
        # and print it
        visited.add(u)

        if u == v:
            return True

        # Recur for all the vertices
        # adjacent to this vertex
        flag=False
        for neighbour in self.graph[u]:
            if neighbour not in visited:
                flag= self.DFSUtil(neighbour, v, visited)
            if flag:
                break
        return flag
    # The function to do DFS traversal. It uses
    # recursive DFSUtil()

    def DFS(self, u, v):

        # Create a set to store visited vertices
        visited = set()

        # Call the recursive helper function
        # to print DFS traversal
        return self.DFSUtil(u, v, visited)



n , t= map(int,input().split())
a=list(map(int,input().split()))
a.insert(0,0)
g=Graph()
for i in range(1,n):
    u=i
    v=i+a[i]
    g.addEdge(u,v)
result=g.DFS(1,t)
if result:
    print('YES')
else:
    print('NO')

