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