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