#include <bits/stdc++.h>
using namespace std;
bool visit[30001];
int main() {
  int n, f, dato;
  cin >> n >> f;
  int pos = 1;
  for (int i = 1; i < n; i++) {
    cin >> dato;
    if (i == pos && pos + dato < 30001) {
      visit[pos + dato] = true;
      pos += dato;
    }
  }
  if (visit[f] == true) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
