#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  k--;
  int a[n - 1];
  for (int i = 0; i < n - 1; i++) cin >> a[i];
  for (int i = 0; i < n - 1;) {
    if (i == k) {
      cout << "YES";
      return 0;
    }
    i += a[i];
    if (i == k) {
      cout << "YES";
      return 0;
    }
    if (a[i] == 0) break;
  }
  cout << "NO";
  return 0;
}
