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.

# n =(input()) ;ln =[] ;ln[:0]=n ;lenn =len(ln) ; Count=0
# m =input()   ;lm =[] ;lm[:0]=m
# for i,j in zip(ln,lm):
#     if i.lower() == j.lower():

#         if Count ==lenn-1:
#             print(0)
#             break
#         Count +=1
#     elif( ascii(i.lower()) < ascii(j.lower())):
#         print('-1')
#         break

#     elif( ascii(i.lower()) > ascii(j.lower())):
#         print('1') 
#         break
    

# n =(input()) ;ln =[] ;ln[:0]=n
# m =input()   ;lm =[] ;lm[:0]=m
# for i in range(len(ln)):
#     print(ln[i],ln[i])
    # if ln[i].lower() == lm[i].lower():
    #     if i==len(ln)-1:
    #         print('0')
    #     else:
    #         continue
    # elif ln[i].lower() != lm[i].lower():
    #     if ascii(ln[i]) < ascii(lm[i]):
    #         print('-1')
    #         break
    #     else:
    #         print('1')
    #         break
 
# strn =input()
# l =[];count =0
# l[:0]=strn
# for i in l:
#     if i =='+':
#         count +=1
#         l.remove(i)
# # print(l)
# l.sort()
# for i in range(2*len(l)-1):
#     if i%2 !=0:
#         l.insert(i,'+')
# # print(l)
# strnn =''
# for i in l:
#     strnn +=i
# print(strnn)

# n =input();l=[];l[:0]=n;l[0] =l[0].upper();strn='';
# for i in l:
#     strn +=i
# print(strn)
# n =int(input())
# #  for i in range(n):
# s =input();l=[];l[:0]=s;count =0;countn =0
# if len(s) ==1:
#     print('0')
# else:
#     for i in rangelen(l)-countn):
#         if l[i]==l[i+1]:
#             l.remove(l[i])
#             count +=1
#             countn +=1
# print(count)

# n =int(input());s =input();l=[];l[:0]=s;i=0;count =0
# while( i <=len(l)-2):
#     if l[i]==l[i+1]:
        
#         l.remove(l[i]);count +=1
#     else:
#         i+=1
# print(count)
# n =input()
# if len(set(n))%2!=0:
#     print('IGNORE HIM!')
# else:
#     print('CHAT WITH HER!')


# limak,bob =[int(x) for x in input().split()]
# year =0;
# while(limak<=bob):
#     year +=1
#     limak =limak*3;bob=bob*2
# print(year)

# n =int(input()); count =0
# while(n>0):
#     if n >=5:
#         n -=5
#     elif n <5 and n>=4:
#         n-=4
#     elif n <4 and n>=3:
#         n-=3
#     elif n <3 and n>=2:
#         n-=2
#     elif n <2 and n>=1:
#         n-=1
#     count +=1
# print(count)
    
# n,k =[int(x) for x in input().split()]

# while(k):
#     if n%10 ==0:
#         n =n/10
#     else:
#         n -=1
#     k-=1
# print(int(n))

# strn =input();l=[];l[:0]=strn;big,small =0,0
# for i in l:
#     if ord(i)<91:
#         big +=1
#     else:
#         small +=1
# if small >= big:
#     for i in range(len(l)):
#         l[i] =l[i].lower()
# else:
#     for i in range(len(l)):
#         l[i] =l[i].upper()
# strn1 =''
# for i in l:
#     strn1 +=i
# print(strn1)
# from os import rename, spawnl


# stops =int(input());total =0;l=[];exitn=[];entern=[]


# for i in range(stops):
#     e,s =[int(x) for x in input().split()]
#     exitn.append(e);entern.append(s)
# if entern[len(exitn)-1]==0 and exitn[0]==0:
#     for i in range(len(exitn)):
#         if total < exitn[i]:
#             print('ayush')
#             break
#         else:
#             total +=entern[i]
#             total -=exitn[i]
#             l.append(total)
#             # print(total)


# print(max(l))

# n=int(input());strn =str(n);l=[];l[:0]=strn
# if l.count('4')+l.count('7') == 4:
#     print('YES')
# elif l.count('4')+l.count('7') == 7:
#     print('YES')
# else:
#     print('NO')


# n =int(input())
# m =input()[::-1]
# l=[];l[:0]=m
# if l.count('A')>l.count('D'):
#     print('Anton')
# elif(l.count('A') == l.count('D')):
#     print('Friendship')
# else:
#     print('Danik')

# n =int(input());
# m =n
# l=[]
# l[:0]=str(n)
# while(1):
#     m+=1
#     if len(set((str(m))))==len(l):
#         print(m);break
    
        



# from typing import Counter


# n,k =[int(x) for x in input().split()] ; count=0
# a=[int(x) for x in input().split()]
# for i in a:
#     if i>k:
#         count +=2
#     else:
#         count+=1
# print(count)

# c =int(input())
# cn=0
# while(c):
#     n,k =[int(x) for x in input().split()] ;
#     if abs(k-n)>=2:
#         cn+=1
#     c -=1
# print(cn)





# n =int(input())
# l=[]
# while(n):
#     l.append(int(input()))
#     n -=1
# count =0
# for i in range(len(l)-1):
#     if l[i]==l[i+1]:
#         count +=0
#     else:
#         count +=1
# print(count+1)



# n =int(input());
# l =[int(x) for x in input().split()];c=0
# for i in set(l):
#     c+=1
# if c>1 :
#     print('HARD')
# elif(c==1 and ):
#     print('EASY')


# n =int(input());l=[int(x) for x in input().split()]
# d={}
# for i in range(1,n+1):
#     d[i] =l[i-1]
# l=[]
# l=list(d.keys())
# l1=[]
# l1=list(d.values())
# for i in range(1,n+1):
#     pos =l1.index(i)
#     print(l[pos],end =" ")


# n =int(input());i=1;strn =''
# while(i<=n):
    
#     if n==1:
#         strn +='I hate it'
#     elif n!=1 and i%2!=0 and i==1 :
#         strn +='I hate that '
#     elif n!=1 and i%2!=0 and i!=n:
#         strn +='I hate that '
#     elif n!=1 and i%2!=0 and i ==n:
#         strn +='I hate it '
#     elif n!=1 and i%2==0 and i==n:
#         strn +='I love it'
#     elif n!=1 and i%2==0 and i!=n:
#         strn +='I love that '
    
#     i +=1
# print(strn)




# l =[int(x) for x in input().split()]
# setn =set(l);count =0;
# for i in setn:
#     count +=1
# if count ==4:
#     print('0')
# else:
#     print(abs(4-count))

# n =int(input());guest=[];host =[];c =0
# for i in range(n):
#     a,b =[int(x) for x in input().split()]
#     host.append(a);
#     guest.append(b)
# for i in range(len(host)):
#     for j in range(len(host)):
#         if j==i:
#             continue
#         elif j!=i and host[i] == guest[j]:
#             c +=1
# print(c)

# t =int(input())

# while(t):
#     i =int(input()) ;l=[]
#     l.append(i)
# for i in l:
#     while()
        


# n =int(input());c1,c0=0,0
# strn =str(n)
# lenn =len(strn);i=0
# print(n)
# print(strn)
# while(i<lenn-1):
    
#     if strn[i]==strn[i+1] and strn[i]=='1':
#         c1 +=1
#     elif strn[i]==strn[i+1] and strn[i]=='0':
#         c0 +=1
#     elif strn[i]=='1' and strn[i+1]=='0':
#         if c1>=7:
#             break
#         else:
#             c1=0
#     elif  strn[i]=='0' and strn[i+1]=='1':
#         if c0>=7:
#             break
#         else:
#             c0=0
#     print(i,c0,c1)
#     i+=1
    
# if c0>=7 or c1>=7:
#     print('YES')
# else:
#     print('NO')


# n =(input())
# n =str(n)
# if ('0'*7 in n or '1'*7 in n):
#     print('YES')
# else:
#     print('NO')

# n =int(input())
# a =[int(x) for x in input().split()]

# a =sorted(a,reverse=True)

# sumn =sum(a);c =0;s=0
# for i in a:
#     if s>sumn/2:
#         break
#     else:
#         s +=i
#         c +=1
# print(c)



# n,k =[int(x) for x in input().split()]
# var =0
# if n%2==0:
#     if k<=n/2:
#         print(int(1+2*(k-1)))
#     else:
#         print(int(2+2*((k-n/2)-1)))
# elif (n%2 !=0):
#     if k<=int(n/2)+1:
#         print(int(1 +2*(k-1)))
#     else:
#         var =int(n/2)+1
#         k =k-var
#         print(int (2 + 2*(k-1)))


# n =input()
# print(type(n))
# if ('H' in n or 'Q' in n or '9' in n or '+' in n):
#     print('YES')
# else:
#     print('NO')
# n =int(input())
# l =[int(x) for x in input().split()];store =[];c =0;
# if len(l)==1:
#     print('1')
# else:

#     for i in range(1,len(l)):
        
#         if l[i-1]<=l[i]:        
#             c +=1
#         else:
#             c =0
#         store.append(c)
#     # if l[len(l)-2]<=len()
#     print(max(store)+1)


# n=int(input())
# l =[int(x) for x in input().split()]
# l =sorted(l)
# for i in l:
#     print(i,end =" ")


# n =int(input());c =0
# l =int(input())
# l =str(l)
# for i in range(1,len(l)-1):
#     # print('yes')
#     # print(l[i-1],l[i])
#     if l[i-1] == l[i]:
#         pass`1`
#     else:
#         c+=1


# t =int(input());c =0
# while(t):
#     n =int(input())
  
#     while(n!=1):
#         # print('round')
#         if n%2==0 and n%6==0:
#             n =int(n/6);c +=1;print(n,'cs1')
        
#         elif n%2==0 and n%6!=0:
#             n =int(n/2); c +=1;print(n,'cs2')
        
#         elif n%2!=0 and n%6==0:
#             n =int(n/6); c +=1;print(n,'cs3')
        
#         elif n%2!=0 and n%6!=0:
#             print('-1')
#             break
#     if n==1:
#         print(c)

   

# for i in range(int(input())):
# 	n=int(input())
# 	a=0	
# 	while n>1:
# 		if n%6==0:
# 			n=n//6;
# 			a+=1
# 		elif n%2!=0:
# 			n=n*2;
# 			a+=1
# 		else:
# 			n=0
# 			a=-1
# 	print(a)


# for i in range(int(input())):
#     n =int(input())
#     while(n >=0):
#         if n==0:
#             print('YES')
#             break
#         elif n <2020:
#             print('NO')
#             break
#         elif n >=2020:
#             if n%10 ==0:
#                 n -=2020
#             elif n%10 !=0:
#                 n -=2021
        

# n =input()
# n =n.replace('WUB',' ')
# l =[];l[:0] =n;
# while( l[0]==' ' ):
#     l.remove(l[0])
# print(''.join(l))


# def f(N):
#     if N==1:
#         print(1)
#         return 1
#     elif N>1:
#         print(N)
#         return f(N-1)
# def printx(n):
#     print('yes')
    
        
                
# t =int(input())
# while(t):
#     n,k =[int(x) for x in input().split()]
#     if n==1 and n==k:
#         print('R')
#     elif n==k and n!=1:
#         print('-1')
#     elif k>n:
#         print('-1')
#     elif n>k :
#         if  n%2==0 and k<=int(n/2):
#             printx(n)
#         elif n%2==0 and k>int(n/2):
#             print('-1')
#         elif n%2!=0 and k<=int((n+1)/2):
#             printx(n)

#         elif n%2!=0 and k>int((n+1)/2):
#             print('-1')
    # t -=1


# for i in range(4):
#     for j in range(4):
#         if i==j and i%2==0 and j!=3:
#             print('R',end ='')
#         elif i==j and i%2==0 and j!=3:
#             print('R',)
#         elif i!=j  and j!=3:
#             print('-1',end='')
#         elif i!=j  and j!=3:
#             print('-1')

            
# n =int(input());i=1;j=n**2
# for x in range(n):
#     for y in  range(int(n/2)):
#         if y==int(n/2)-1:
#             print(i,j)
#         else:
#             print(i,j,end =' ')
#             i+=1;j-=1;
        
        
#     i+=1;j-=1;




# strn =input();strn =strn.lower()
# l=[]; l[:0]=strn
# vowel =["a","e","i","o","u","y"]
# i =0
# while(i<len(l)):
#     if l[i] in vowel:
#         l.pop(i)
#     else:
#         var =l[i]
#         var ='.'+var
#         l.pop(i)
#         l.insert(i,var)
#         i +=1
    
# listToStr = ''.join(map(str, l))
# print(listToStr)
        
# n,m,a =[int(x) for x in input().split()]
# print((-n//a) *( -m//a))

# n=int(input());print(["YES","NO"][all(n%i for i in[4,7,47,744,477])])



# s,n =[int(x) for x in input().split()]
# xlist =[]; ylist =[]
# for i in range(n):
#     x,y =[int(x) for x in input().split()]
#     xlist.append(x) ;ylist.append(y) ;
# print(xlist,ylist)
# for i in range(n):
#     if s<xlist[i]:
#         break
#     else:
#         s -=xlist[i]
#         y +=ylist[i]

# if i ==n-1:
#     print('YES')
# else:
#     print('NO')


# t =int(input())
# for i in range(t):
#     n =int(input())
#     l=[]
#     a =[int(x) for x in input().split()]
#     b =[int(x) for x in input().split()]
#     for i in range(n):
#         if a[i]==b[i]:
#             pass
#         elif(a[i]>b[i]):
            
#             break
#         else:
#             l.append(b[i] -a[i])
    
#     if (len(set(l)) ==1 or len(set(l)) ==0) and (i==n-1) and i!=0:
#         print('Yes')
#     else:
#         print('No')
# def xor(x):
#     if max(x)>=X[-1]:

# t =int(input())
# for i in range(t):
#     n =int(input())
#     lst =[int(x) for x in input().split()]
#     if len(lst)%2==0:
#         print('YES')
#     else:
#         for i in range(len(lst)):
#             if lst[i]>lst[i+1]
#                 print('YES')
#                 k=1 
#                 break
#             else:
#                 if i==Len(lst)-1 and k==1:
#                     print('NO')
#                     break
#n is number of lantens .
# l is length of streeet light.    
# 
# 
# 
#               
# n,l =[int(x) for x in input().split()]
# a =[int(x) for x in input().split()]
# a =sorted(a)
# maxn =0;lenn =len(a)
# if n==1:
#     print(max(a[0],l-a[0]))
# else:
#     if 0==a[0] and l==a[-1]:
#         for i in range(lenn-1):
#             if maxn <abs( a[i] -a[i+1]):
#                 maxn =abs( a[i] -a[i+1])
#                 # print('maxn is ',maxn)
#         print(maxn/2)
#     if 0!=a[0] and l!=a[-1]:
#         for i in range(lenn-1):
#             if maxn <abs( a[i] -a[i+1]):
#                 maxn =abs( a[i] -a[i+1])
#         print(max( a[0],abs(a[-1] -l) ,maxn)/2)
#     if 0==a[0] and l!=a[-1]:
#         for i in range(lenn-1):
#             if maxn <abs( a[i] -a[i+1]):
#                 maxn =abs( a[i] -a[i+1])
#         print(max(abs(a[-1] -l) ,maxn)/2)
#     if 0!=a[0] and l==a[-1]:
#         for i in range(lenn-1):
#             if maxn <abs( a[i] -a[i+1]):
#                 maxn =abs( a[i] -a[i+1])
#         print(max(a[0] ,maxn)/2)

 
 
 
    # if 0 in a and l in a:
    #     for i in range(len(a)-1):
    #         if maxn <(a[i]-a[i+1]):
    #             maxn =(a[i]-a[i+1])
    #     print(maxn/2)
    # if 0 not in a and l not in a:
    #     for i in range(len(a)-1):
    #         if maxn <(a[i]-a[i+1]):
    #             maxn =(a[i]-a[i+1])
    #     print(max(maxn/2,a[0],abs(a[-2] - a[-1])))
    # if 0 not in a and l in a:
    #     for i in range(len(a)-1):
    #         if maxn <(a[i]-a[i+1]):
    #             maxn =(a[i]-a[i+1])
    #     print(max(maxn/2,a[0])
    # if 0 in a and l not in a:
    #     for i in range(len(a)-1):
    #         if maxn <(a[i]-a[i+1]):
    #             maxn =(a[i]-a[i+1])
    #     print(max(maxn/2 ,abs(a[-2] - a[-1]))



# li =[] ;maxn =0 
# n =int(input())
# l =[int(x) for x in input().split()]
# for i in range(len(l)):
#     if l[i] ==0:
#         li.append(i)
# print(li)
# for i in range(len(li)):
#     for j in range(i,len(li)):
#         li[j] =1 -li[j]




# cook your dish here
# t =int(input())
# while(t):
#     n,k=[int(x) for x in input().split()]
#     s =input()
#     count =0
    
#     arr =[];ultaarr =[]
#     arr[:0]=s

#     for i in range(len(arr)):
#         arr[i] =int(arr[i])
#     ultaarr =arr[::-1]
#     # print('The value of k is ',k)

    
    
    
#     for i in range(len(arr)):
#         if arr[i]==ultaarr[i]:
#             pass
#         else:
#             arr[i] =abs(1-arr[i])
#             ultaarr =arr[::-1]
#             count +=1
#     # print('The value of count  is ',count)       
#     if count <=k:
#         print('YES')
#     else:
#         print('NO')
#     t -=1

# t =int(input());c =0
# while(t):
#     strn =input()
#     i=0
    
#     while(i<len(strn)):
#         if strn[i]=='+':
#             c +=1 ;i +=2
#         elif strn[i]=='-':
#             c -=1 ;i +=2
#         elif strn[i]=='X':
#             c +=0 ;i +=1
#     # c =count +0

#     t-=1
# print(c)
        
# t =int(input())
# t =str(t)
# l =[]
# l[:0] =t
# strn =''
# for i in range(len(l)):
#     l[i] =int(l[i])

# for i in range(len(l)):
#     if l[i]!=9:
#         l[i] =min(l[i] ,9-l[i])
#         l[i] =str(l[i])
#         strn +=l[i]
#     else:
#         if i==0:
#             l[i] =str(l[i])
#             strn +=l[i]
#         else:
#             l[i] =min(l[i] ,9-l[i])
#             l[i] =str(l[i])
#             strn +=l[i]

# print(strn)


# given =int(input())
# cubes_per_height=0
# total_cubes =0
# height =0
# diff =1
# while(total_cubes+diff +cubes_per_height<=given):
#     cubes_per_height +=diff
#     diff +=1
#     height +=1
#     total_cubes +=cubes_per_height
#     # print('total cubes',total_cubes)
#     # print('cubes per height',cubes_per_height)
#     # print('height',height)
#     # print('diff',diff)
# print(height)






# def ffun(l):
#     strn =''
#     for i in range(len(l)):
#         l[i]=str(l[i])
#     for i in range(len(l)):
#         strn+=l[i]

#     return int(strn)

# i =input()
# l=[1]
# itr =1
# sum =0
    
#     while(ffun(l)<=10000 or ffun(l)==i ):
#         itr +=1
#         l =l*itr
#         sum +=len(l)



'''Wrong code '''
# test =int(input())
# while(test):
#     n =int(input())
#     arr =[];waste_arr =[] 
    
#     for i in range(n):
#         arr.append(i+1)

#     while(len(arr)!=1):
#         var =round( (arr[0]+arr[-1]) /2 ,0 )
#         waste_arr.append(int(arr[0]))
#         waste_arr.append(int(arr[-1]))
#         arr.remove(arr[0]) ;arr.remove(arr[-1])
        
#         arr.append(var)
#         arr =sorted(arr)
#     # print(waste_arr)
#     print(int(arr[0]))
#     varlen =int(len(waste_arr))
#     while(varlen!=0):
#         print(int(arr[0]))
#         print(waste_arr[0],waste_arr[1])
#         waste_arr.remove(waste_arr[0])
#         waste_arr.remove(waste_arr[1])
#         varlen -=2


# t =int(input())
# for i in range(t):
#     n =int(input())
#     arr =[int(x) for x in input().split()]
#     if len(arr)==1:
#         print('NO')
#     else:    
#         if arr[-1]==min(arr):
#             print('YES')
#         else:
#             print('NO')
    # sort_arr =sorted(arr)
    # first=[]
    # last =[]
    # new_arr =[]
    # var =0
    # for i in range(1,n-1):
    #     first =arr[0:i]
    #     first =sorted(first)
    #     last =arr[i : n]
    #     last =sorted(last)
    #     new_arr =first +last
    #     if new_arr == sort_arr:
    #         print('NO')
    #         break
    #     else:
    #         var =1
    #     first.clear()
    #     last.clear()
    #     new_arr.clear()
    # # print(new_arr)
    # if var ==1:
    #     print('YES')


# t =int(input())
# for i in range(t):
#     n =int(input()) ;sum =0
#     arr =[int(x) for x in input().split()]
#     if len(arr)>3:
#         for i in range(1,n-1):
#             if arr[i]%2==0:
#                 # print(1)
#                 sum +=int(arr[i]/2)
#                 # print('now adding ',int(arr[i]/2))
#             elif arr[i]%2!=0 and arr[i]==1:
#                 # print(2)
#                 sum +=1
#                 # print('now adding ',1)
#             elif arr[i]%2!=0 and arr[i]!=1:
#                 # print(3)
#                 sum +=int(arr[i]%2) + 1
#                 # print('now adding ',int(arr[i]%2) + 1)
#     else:
#         if len(arr)==1:
#             sum =-1
#         elif len(arr)==2:
#             sum =-1
#         elif len(arr)==3:
#             if arr[1]%2!=0:
#                 sum =-1
#             elif arr[1]%2==0:
#                 sum +=(int(arr[1]/2))
#     print(sum)
# t =int(input())
# for i in range(t):
#     n =int(input())
#     arr =[int(x) for x in input().split()]

t,n =[int(x) for x in input().split()]
arr =[int(x) for x in input().split()] ;lenn =len(arr)
sum =0 ;i=0
while(i<n):
    i =(i+1) + arr[i]
    if i>n:
        print('NO')
        break
    elif i==n:
        print('YES')
        break
    elif i==n-2:
        print('No')
        break
    else:
        pass

