#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, t, x, k, i, flag = 0;
  cin >> n >> t;
  k = n;
  unordered_map<long long int, long long int> mp;
  mp.reserve(1024);
  mp.max_load_factor(0.25);
  for (i = 1; i < n; i++) {
    cin >> x;
    mp[i] = (i + x);
  }
  k = 1;
  while (mp[k] <= t) {
    if (mp[k] == t) {
      flag = 1;
      break;
    }
    k = mp[k];
  }
  if (flag == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
