#include <bits/stdc++.h>
using namespace std;
vector<int> adj[90007];
vector<bool> visited(90007, false);
bool dfs(int t) {
  stack<int> second;
  second.push(1);
  visited[1] = true;
  while (!second.empty()) {
    int u = second.top();
    second.pop();
    for (int i = 0; i < adj[u].size(); i++) {
      int v = adj[u][i];
      if (visited[v] == false) {
        visited[v] = true;
        second.push(v);
        if (visited[t] == true) return true;
      }
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int edge, target;
  cin >> edge >> target;
  for (int i = 1; i < edge; i++) {
    int x;
    cin >> x;
    adj[i].push_back(x + i);
  }
  if (dfs(target))
    cout << "YES\n";
  else
    cout << "NO\n";
}
