#include <bits/stdc++.h>
using namespace std;
list<int> *adj;
int n, t;
vector<bool> vis;
void dfs(int v, int t) {
  vis[v] = true;
  for (auto u : adj[v]) {
    if (!vis[u]) {
      dfs(u, t);
    }
  }
}
int main(void) {
  cin >> n >> t;
  adj = new list<int>[n + 1];
  for (int i = 1; i < n; i++) {
    int v;
    cin >> v;
    adj[i].push_back(i + v);
  }
  vis.resize(n + 1, false);
  dfs(1, t);
  if (vis[t])
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
