#include <bits/stdc++.h>
using namespace std;
int a[30010];
int main() {
  int n, t;
  while (scanf("%d%d", &n, &t) != EOF) {
    for (int i = 1; i < n; i++) scanf("%d", &a[i]);
    int p = 1;
    while (p < t) p = p + a[p];
    if (p == t)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
