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