#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, t;
  cin >> n >> t;
  long int arr[n + 1];
  bool visited[n + 1];
  for (long int i = 1; i < n; i++) {
    cin >> arr[i];
    visited[i] = false;
  }
  long int i = 1;
  while (visited[i] == false && i != t && i != n) {
    visited[i] = true;
    i = i + arr[i];
  }
  if (i == t) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
