#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e4 + 5;
int a[maxn];
int main() {
  memset(a, 0, sizeof(a));
  int n, t;
  cin >> n >> t;
  for (int i = 1; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int id = 1;
  while (id < t) {
    id += a[id];
  }
  if (id == t)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
