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