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