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