#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e4 + 10;
int s[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i < n; i++) scanf("%d", &s[i]);
  int k = 1;
  bool flag = false;
  while (k <= m) {
    if (k == m) {
      flag = true;
      break;
    } else {
      k = s[k] + k;
    }
  }
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
}
