#include <bits/stdc++.h>
using namespace std;
const int maxN = 100 * 1000 + 1;
const int mod = 1000 * 1000 * 1000 + 7;
int mark[maxN];
int a[maxN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, t;
  cin >> n >> t;
  for (int i = 0; i < n - 1; i++) cin >> a[i];
  mark[0] = 1;
  for (int i = 0; i < n - 1; i++) {
    mark[i + a[i]] |= mark[i];
  }
  cout << (mark[t - 1] ? "YES" : "NO") << endl;
  return 0;
}
