#include <bits/stdc++.h>
using namespace std;
bool k = false;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n + 5];
  for (long long i = 1; i <= n - 1; i++) {
    cin >> a[i];
  }
  if (m == 1) {
    cout << "YES" << endl;
    return 0;
  }
  long long r = 1;
  for (long long i = 1; i <= n; i++) {
    r = a[i] + i;
    if (r == m) k = true;
    i = r - 1;
  }
  if (k == true)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
