#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int t;
  bool flag = false;
  cin >> n >> t;
  t = t - 1;
  vector<int> graph(n - 1);
  for (int i = 0; i < n - 1; i++) cin >> graph[i];
  graph.push_back(1);
  for (int i = 0; i < n; i = i + graph[i]) {
    if (i == t) {
      flag = true;
      break;
    }
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
}
