#include <bits/stdc++.h>
using namespace std;
int count1 = 0;
vector<int> v[100005];
bool visited[100005] = {0};
void dfs(int s) {
  visited[s] = true;
  for (int i = 0; i < v[s].size(); i++) {
    if (visited[v[s][i]] == false) {
      visited[v[s][i]] = true;
      dfs(v[s][i]);
    }
  }
}
int main() {
  int n, m, a, b, d;
  cin >> n >> d;
  for (int i = 1; i < n; i++) {
    cin >> a;
    v[i].push_back(a + i);
  }
  dfs(1);
  if (visited[d])
    cout << "YES\n";
  else
    cout << "NO\n";
}
