#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const int mxn = 3e4;
int n, t;
vector<int> adj[mxn];
vector<bool> vis(mxn, 0);
void dfs(int v) {
  vis[v] = 1;
  for (int u : adj[v]) {
    if (!vis[u]) {
      vis[u] = 1;
      dfs(u);
    }
  }
}
void bfs(int s) {
  vis[s] = 1;
  queue<int> q;
  q.push(s);
  while (q.size()) {
    int v = q.front();
    q.pop();
    for (int u : adj[v]) {
      if (!vis[u]) {
        vis[u] = 1;
        q.push(u);
      }
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(time(NULL));
  ;
  cin >> n >> t;
  for (int i = 0, x; i < n - 1; ++i) {
    cin >> x;
    adj[i].push_back(i + x);
  }
  bfs(0);
  cout << (vis[t - 1] ? "YES" : "NO") << '\n';
  return 0;
}
