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