#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > graph(30001);
int visited[30001] = {0};
bool dfs(int pos, int end) {
  if (pos == end) {
    return true;
  } else {
    for (int x = 0; x < graph[pos].size(); x++) {
      if (visited[graph[pos][x]] == 0) {
        visited[graph[pos][x]] = 1;
        if (dfs(graph[pos][x], end)) {
          return true;
        }
      }
    }
  }
  return false;
}
int main() {
  int n, t, current;
  cin >> n >> t;
  for (int x = 1; x <= n; x++) {
    cin >> current;
    graph[x].push_back(x + current);
  }
  if (dfs(1, t)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
