#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t;
  cin >> n >> t;
  long long a[n - 1];
  for (long long i = 0; i < n - 1; i++) {
    cin >> a[i];
  }
  long long temp = 0, flag = 0;
  while (temp <= (t - 1)) {
    temp = temp + a[temp];
    if (temp == (t - 1)) {
      flag = 1;
      break;
    }
  }
  if (flag == 1) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
