#include <bits/stdc++.h>
using namespace std;
bool binary(vector<int>& vis, int x) {
  int l = 0;
  int r = vis.size() - 1;
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (vis[m] < x)
      l = m;
    else
      r = m;
  }
  return vis[r] == x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, x;
  cin >> n >> x;
  vector<int> a(n);
  for (int i = 1; i < n; ++i) cin >> a[i];
  vector<int> vis;
  vis.push_back(1);
  for (int i = 1; i < n; ++i) {
    vis.push_back(i + a[i]);
    i = i + a[i] - 1;
  }
  if (binary(vis, x))
    cout << "YES";
  else
    cout << "NO";
}
