#include <bits/stdc++.h>
using namespace std;
const long long N = 100000;
const long long NN = 105;
const long long MAX = 2e5 + 123;
const long long MOD = 1e9 + 8;
long long n, t, a[N];
vector<long long> g[N];
bool u[N], y;
void dfs(long long v) {
  u[v] = 1;
  if (v == t) y = 1;
  for (long long i = 0; i < g[v].size(); i++) {
    if (u[g[v][i]] == 0) dfs(g[v][i]);
  }
}
int main() {
  scanf("%I64d%I64d", &n, &t);
  for (long long i = 1; i < n; i++) {
    scanf("%I64d", &a[i]);
    g[i].push_back(i + a[i]);
  }
  dfs(1);
  if (y)
    printf("YES");
  else
    printf("NO");
}
