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