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