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