#include <bits/stdc++.h>
using namespace std;
int N, idx, A;
int main(void) {
  std::cin >> N;
  cin >> idx;
  int currIdx = 1;
  int b = 1;
  while (N--) {
    cin >> A;
    currIdx += A;
    b++;
    if (currIdx > b) {
      while (currIdx > b) {
        cin >> A;
        b++;
      }
    }
    if (currIdx >= idx) break;
  }
  if (currIdx == idx) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
