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