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