#include <bits/stdc++.h>
using namespace std;
void fastrun() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
void noober() {
  long long int p, q;
  cin >> p >> q;
  long long int ar[p];
  for (long long int i = 0; i < p - 1; i++) {
    cin >> ar[i];
  }
  for (long long int i = 0; i < p - 1;) {
    i += ar[i];
    if (i == (q - 1)) {
      cout << "YES";
      return;
    }
  }
  cout << "NO";
}
int main() {
  fastrun();
  noober();
  return 0;
}
