#include <bits/stdc++.h>
class graph {
  long int V;
  std::list<long int> *adj;

 public:
  void add(long int u, long int v);
  void dfs(long int s, long int k);
  graph(long int V);
};
graph::graph(long int V) {
  this->V = V;
  adj = new std::list<long int>[V];
}
void graph::add(long int u, long int v) { adj[u].push_back(v); }
void graph::dfs(long int s, long int k) {
  int flag = 0;
  std::vector<bool> visited(V, false);
  std::stack<long int> stk;
  stk.push(s);
  while (stk.size()) {
    long int p = stk.top();
    stk.pop();
    if (!visited[p]) {
      visited[p] = true;
    }
    std::list<long int>::iterator it;
    for (it = adj[p].begin(); it != adj[p].end(); ++it) {
      if (!visited[*it]) {
        visited[*it] = true;
        stk.push(*it);
      }
    }
  }
  for (long int j = 0; j < V; j++) {
    if (visited[j] && j == k) {
      std::cout << "YES\n";
      flag = 1;
      break;
    }
  }
  if (!flag) {
    std::cout << "NO\n";
  }
}
int main() {
  long int p = 0, q = 0, a = 0;
  std::cin >> p >> q;
  graph g(p + 1);
  for (long int i = 1; i <= p - 1; i++) {
    std::cin >> a;
    g.add(i, i + a);
  }
  g.dfs(1, q);
  return 0;
}
