#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  int tab[n];
  tab[0] = 0;
  for (int i = 1; i < n; ++i) cin >> tab[i];
  int i = 1;
  while (i < k) {
    i += tab[i];
  }
  if (i == k)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
