#include <bits/stdc++.h>
using namespace std;
int main() {
  long long cell;
  long long move;
  cin >> cell;
  cin >> move;
  if (move == 1) {
    cout << "YES";
    return 0;
  }
  long long x[100001];
  for (int i = 0; i < cell - 1; i++) {
    cin >> x[i];
  }
  long long sum = x[0] + 1;
  if (move == sum) {
    cout << "YES";
    return 0;
  }
  while (sum <= cell - 1) {
    sum = x[sum - 1] + sum;
    if (move == sum) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
