#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> cells;
  int n, t, x;
  bool check = false;
  cin >> n >> t;
  cells.push_back(-10);
  for (int i = 1; i < n; i++) {
    cin >> x;
    cells.push_back(x);
  }
  for (int i = 1; i <= n;) {
    if (i == t) {
      check = true;
      break;
    } else {
      if (i > t) {
        check = false;
        break;
      } else {
        i = i + cells[i];
        check = false;
      }
    }
  }
  if (check)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
