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