#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, t, pos = 1;
  bool found = false;
  cin >> n >> t;
  for (int i = 1; i <= n - 1; i++) {
    int a;
    cin >> a;
    found |= (pos == t);
    if (i == pos) pos = i + a;
  }
  found |= (pos == t);
  if (found)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
