#include <bits/stdc++.h>
using namespace std;
vector<int> ar[100001];
int vis[100001], a[100001];
void dfs(int node) {
  vis[node] = 1;
  for (int i = 0; i < ar[node].size(); i++) {
    int child = ar[node][i];
    if (vis[child] == 0) dfs(child);
  }
}
void buildGraph(int n) {
  for (int i = 1; i < n;) {
    ar[i].push_back(i + a[i]);
    i += a[i];
  }
}
int main() {
  int n, t;
  cin >> n >> t;
  for (int i = 1; i < n; i++) cin >> a[i];
  buildGraph(n);
  dfs(1);
  if (vis[t] == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
