#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, t, a[100005];
  scanf("%d%d", &n, &t);
  for (i = 0; i < n - 1; i++) {
    scanf("%d", &a[i]);
    a[i] += i;
  }
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    int f = q.front();
    q.pop();
    if (f == t - 1) {
      cout << "YES"
           << "\n";
      return 0;
    }
    if (f == n - 1) break;
    q.push(a[f]);
  }
  cout << "NO"
       << "\n";
  return 0;
}
