#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, k = 1, r;
  cin >> n >> t;
  int ar[n - 1];
  for (int i = 1; i < n; i++) {
    cin >> ar[i];
  }
  while (true) {
    int j = k + ar[k];
    if (j < t) {
      r = k;
      k = r + ar[r];
    } else if (j == t) {
      cout << "YES";
      return 0;
    } else {
      cout << "NO";
      return 0;
    }
  }
  return 0;
}
