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