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