#include <bits/stdc++.h>
using namespace std;
int vis[3 * 10005];
vector<int> adj[3 * 10005];
void dfs(int u) {
  vis[u] = 1;
  for (int i = 0; i < adj[u].size(); i++) {
    int child = adj[u][i];
    if (vis[child] == 0) {
      dfs(child);
    }
  }
}
int main() {
  int t, n, m, x, y;
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    cin >> x;
    adj[i].push_back(i + x);
  }
  dfs(1);
  if (vis[m]) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
