#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> n >> t;
  vector<pair<int, int>> adj(n - 1);
  int a[n];
  for (int i = 0; i < n - 1; i++) {
    cin >> a[i];
    adj[i].first = i + 1;
    adj[i].second = i + 1 + a[i];
  }
  int flag = 0;
  for (int i = 0; i < n - 1; i++) {
    if (adj[i].second == t) {
      flag = 1;
      break;
    } else {
      i = adj[i].second - 2;
    }
  }
  if (flag == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
