#include <bits/stdc++.h>
const long long MOD = 1000000007;
bool solve(const std::vector<std::vector<long long> >& graph, long long& t) {
  std::vector<bool> visited(graph.size(), false);
  std::stack<long long> q;
  q.push(1);
  visited[1] = true;
  while (!q.empty()) {
    long long temp = q.top();
    if (temp == t) {
      return true;
    }
    q.pop();
    for (long long i = 1; i < graph[temp].size(); ++i) {
      long long val = graph[temp][i];
      if (val == t) {
        return true;
      }
      if (!visited[val]) {
        visited[val] = true;
        q.push(val);
      }
    }
  }
  return false;
}
int main() {
  long long n, t;
  std::cin >> n >> t;
  std::vector<std::vector<long long> > graph(n + 1,
                                             std::vector<long long>(1, 0));
  for (int i = 1; i <= n - 1; ++i) {
    long long val;
    std::cin >> val;
    graph[i][0] = i;
    graph[i + val][0] = i + val;
    graph[i].push_back(i + val);
  }
  if (solve(graph, t)) {
    std::cout << "YES" << std::endl;
  } else {
    std::cout << "NO" << std::endl;
  }
  return 0;
}
