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