#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t;
  cin >> t;
  int arr[n + 1];
  for (int i = 1; i <= n - 1; i++) cin >> arr[i];
  arr[n] = 0;
  bool used[n + 1];
  for (int i = 1; i <= n; i++) used[i] = false;
  int u = 1;
  while (!used[u]) {
    used[u] = true;
    u += arr[u];
  }
  if (used[t])
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
