#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
const int mod = 998244353;
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0)
    if (b & 1) {
      res = (long long)(res * 1ll * a) % mod;
      --b;
    } else {
      a = (long long)(a * a) % mod;
      b >>= 1;
    }
  return (long long)res;
}
vector<bool> used;
vector<vector<int>> g;
int k;
bool flag = false;
void dfs(int v) {
  used[v] = true;
  if (k == v + 1) {
    flag = true;
    return;
  }
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (!used[to]) dfs(to);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n >> k;
  g.resize(n);
  used.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int a;
    cin >> a;
    g[i].push_back(i + a);
  }
  dfs(0);
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
