#include <bits/stdc++.h>
using namespace std;
int query(int n, int arr[], int t) {
  int j = 1;
  while (j <= n - 1) {
    j = j + arr[j - 1];
    if (t == j) {
      return 1;
    }
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  int t;
  cin >> t;
  int arr[n - 1];
  for (int i = 0; i < (n - 1); i++) {
    cin >> arr[i];
  }
  if (query(n, arr, t) == 1) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
