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