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