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