#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int aray[100007];
  while (scanf("%d %d", &n, &m) != EOF) {
    for (int i = 1; i < n; i++) {
      scanf("%d", &aray[i]);
    }
    int sum = 0, i = 1;
    bool flag = false;
    while (true) {
      sum = (i + aray[i]);
      i = sum;
      if (sum == m) {
        flag = true;
        break;
      }
      if (sum > m) {
        break;
      }
    }
    (flag) ? printf("YES\n") : printf("NO\n");
  }
  return 0;
}
