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