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