#include <bits/stdc++.h>
using namespace std;
int n[100001] = {0};
int main() {
  int m, num, i, f = 0;
  cin >> m >> num;
  for (i = 0; i < m - 1; i++) cin >> n[i];
  num -= 1;
  for (i = 0; i < m - 1;) {
    i += n[i];
    if (i == num) {
      f = 1;
      cout << "YES" << endl;
      break;
    }
  }
  if (f == 0) {
    cout << "NO" << endl;
  }
  return 0;
}
