#include <bits/stdc++.h>
using namespace std;
const int IINF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const double DINF = numeric_limits<double>::infinity();
const int MOD = 1000000007;
const double EPS = 1e-9;
const int DX[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int DY[] = {0, 1, 0, -1, 1, -1, -1, 1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long sqr(long long x) { return x * x; }
long long sqr(int x) { return (long long)x * x; }
double sqr(double x) { return x * x; }
long double sqr(long double x) { return x * x; }
mt19937 mmtw(960172);
long long rnd(long long x, long long y) {
  static uniform_int_distribution<long long> d;
  return d(mmtw) % (y - x + 1) + x;
}
vector<int> al[30000];
stack<int> s;
bool visited[30000] = {0};
int n, k;
int dfs(int r) {
  visited[r] = true;
  for (int i = 0; i < al[r].size(); i++) {
    if (!visited[al[r][i]]) {
      if (al[r][i] == k - 1) {
        return 1;
      } else {
        return dfs(al[r][i]);
      }
    }
  }
}
int main() {
  cin >> n >> k;
  int count = 0;
  int x;
  for (int i = 0; i < n - 1; i++) {
    cin >> x;
    al[i].push_back(x + i);
    if (x + i == k - 1) {
      count++;
    }
  }
  if (count == 0) {
    cout << "NO" << endl;
  } else {
    if (dfs(0) == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
