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