#include <bits/stdc++.h>
using namespace std;
void dfs(int n, const vector<int>& g, vector<int>& vis, int t) {
  if (n == t) {
    cout << "YES" << '\n';
  } else {
    if (n >= g.size() || vis[n] == 1) {
      cout << "NO" << '\n';
    } else {
      vis[n] = 1;
      dfs(g[n], g, vis, t);
    }
  }
}
int main() {
  int n, t;
  cin >> n >> t;
  vector<int> graph(n);
  for (int i = 1; i <= n - 1; i++) {
    int a;
    cin >> a;
    graph[i] = i + a;
  }
  vector<int> vis(n, 0);
  dfs(1, graph, vis, t);
  return 0;
}
