#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, t;
  cin >> n >> t;
  int cur = 0;
  int train[n - 1];
  for (int i = 0; i < n - 1; i++) {
    int temp;
    cin >> temp;
    train[i] = i + temp;
  }
  while (cur <= t - 1) {
    if (cur == t - 1) {
      cout << "YES";
      return 0;
    }
    cur = train[cur];
  }
  cout << "NO";
  return 0;
}
