#include <bits/stdc++.h>
using namespace std;
int n, t;
vector<int> adj[100005];
int visited[100005];
void dfs(int n) {
  visited[n] = 1;
  for (int i = 0; i < adj[n].size(); i++)
    if (visited[adj[n][i]] == 0) dfs(adj[n][i]);
}
int main() {
  cin >> n >> t;
  int i;
  for (i = 1; i < n; ++i) {
    int x;
    cin >> x;
    adj[i].push_back(i + x);
  }
  dfs(1);
  if (visited[t] == 0)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
