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