#include <bits/stdc++.h>
using namespace std;
int arr[100001];
vector<int> newyr[100001];
void dfs(int node) {
  arr[node] = 1;
  int child;
  for (int i = 0; i < newyr[node].size(); i++) {
    child = newyr[node][i];
    if (arr[child] == 0) dfs(child);
  }
}
int main() {
  int n, t, a;
  cin >> n >> t;
  for (int i = 1; i < n; i++) {
    cin >> a;
    newyr[i].push_back(a + i);
  }
  dfs(1);
  if (arr[t] == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
