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