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