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