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