public static void main (String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int[] a = new int[n+1];
for(int i=1 ; i<=n ; i++)
a[i] = sc.nextInt();
Graph g = new Graph();
for(int i=1 ; i<=n ; i++)
{
if(i+a[i]<=n)
g.add(i , i+a[i]);
if(i-a[i]>0)
g.add(i , i-a[i]);
}
HashMap<Integer , Integer> visited = new HashMap<>();
if( g.dfs(k , visited , a) )
System.out.println("YES");
else
System.out.println("NO");
//g.print();
}
static class Graph
{
HashMap<Integer , ArrayList<Integer>> graph;
Graph()
{
graph = new HashMap<>();
}
public void add(int a , int b)
{
if(!graph.containsKey(a))
graph.put(a , new ArrayList<>());
graph.get(a).add(b);
}
public boolean dfs(int i , HashMap<Integer , Integer> visited , int[] a)
{
visited.put(i , 1);
if(a[i]==0) return true;
for(int j: graph.get(i))
if(!visited.containsKey(j))
if( dfs(j , visited , a) )
return true;
return false;
}
public void print()
{
for(int i: graph.keySet())
System.out.println(i+" - "+graph.get(i));
}
}