#include <bits/stdc++.h>
using namespace std;
long long vis[300005], a[300005];
void dfs(long long v) {
  if (vis[v]) return;
  vis[v] = 1;
  dfs(v + a[v]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t = 1;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    long long i;
    for (i = 1; i < n; i++) cin >> a[i];
    dfs(1);
    if (vis[m])
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
