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