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