#include <bits/stdc++.h>
using namespace std;
void addedge(long long int* graph, int start, int end) { graph[start] = end; }
int main() {
  long long int n, t;
  cin >> n >> t;
  long long int graph[n];
  long long int i, a[n];
  for (i = 1; i <= n - 1; i++) {
    cin >> a[i];
    addedge(graph, i, i + a[i]);
  }
  long long int endt = 1;
  while (true) {
    if (endt == t) {
      cout << "YES" << endl;
      break;
    }
    if (endt >= n) {
      cout << "NO" << endl;
      break;
    }
    endt = graph[endt];
  }
}
