#include <bits/stdc++.h>
using namespace std;
class Graph {
  int V;
  list<int> *adj;

 public:
  Graph(int V);
  void addEdge(int v, int w);
  bool BFS(int s, int look);
  void DFS(int s);
  void DFSUtil(int s, bool visited[]);
};
Graph::Graph(int V) {
  this->V = V;
  adj = new list<int>[V];
}
void Graph::addEdge(int v, int w) { adj[v].push_back(w); }
bool Graph::BFS(int s, int look) {
  vector<bool> visited(V);
  for (int i = 0; i < V; i++) visited[i] = false;
  list<int> que;
  visited[s] = true;
  if (s == look) return 1;
  que.push_back(s);
  list<int>::iterator it;
  while (!que.empty()) {
    s = que.front();
    que.pop_front();
    for (it = adj[s].begin(); it != adj[s].end(); it++) {
      if (!visited[*it]) {
        if (*it == look) return 1;
        que.push_back(*it);
        visited[*it] = true;
      }
    }
  }
  return visited[look];
}
void Graph::DFSUtil(int s, bool visited[]) {
  visited[s] = true;
  cout << s << " ";
  list<int>::iterator it;
  for (it = adj[s].begin(); it != adj[s].end(); it++) {
    if (!visited[*it]) {
      DFSUtil(*it, visited);
    }
  }
}
void Graph::DFS(int s) {
  bool *visited = new bool[V];
  for (int i = 0; i < V; i++) visited[i] = false;
  DFSUtil(s, visited);
}
int main() {
  int n, t;
  cin >> n >> t;
  Graph mygraph(n + 1);
  for (int i = 1; i < n; i++) {
    int ai;
    cin >> ai;
    mygraph.addEdge(i, i + ai);
  }
  if (mygraph.BFS(1, t)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
