#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, t;
  cin >> n >> t;
  vector<long long int> a(n - 1), mark(n + 1, -1);
  for (int i = 0; i < n - 1; i++) cin >> a[i];
  long long int s = 1;
  while (mark[s] == -1) {
    mark[s] = 1;
    if (s <= a.size()) s = s + a[s - 1];
  }
  if (mark[t] == 1)
    cout << "YES";
  else
    cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
