#include <bits/stdc++.h>
const int maxn = 30000 + 10;
int a[maxn];
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  for (int i = 1; i < n; ++i) scanf("%d", &a[i]);
  int cur = 1;
  while (cur < t && cur <= n - 1) cur += a[cur];
  if (cur == t)
    puts("YES");
  else
    puts("NO");
  return 0;
}
