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