#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MAXN = 1e6;
long long power(long long x, long long n, long long mod = 1e18 + 7) {
  if (n == 0) return 1ll;
  if (n & 1ll) return power(x, n - 1ll, mod) * x % mod;
  long long tmp = power(x, n >> 1ll, mod);
  return (tmp * tmp) % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
void print(long long c) {
  vector<string> ans = {"Sheldon", "Leonard", "Penny", "Rajesh", "Howard"};
  cout << ans[c] << "\n";
}
signed main() {
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(924653523);
  long long n, k;
  cin >> n >> k;
  k--;
  vector<long long> a(n - 1);
  for (long long i = 0; i < n - 1; i++) {
    cin >> a[i];
  }
  long long p = 0;
  while (p < k) {
    p = p + a[p];
  }
  if (p == k) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
