#include <bits/stdc++.h>
using namespace std;
const int maxn = 30030;
const int maxm = 10000;
const int inf = 0x3f3f3f3f;
int vis[maxn];
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  vector<int> vec[maxn];
  for (int i = 1; i < n; i++) {
    int a;
    scanf("%d", &a);
    vec[i + a].push_back(i);
  }
  queue<int> q;
  q.push(t);
  int flag = 0;
  while (!q.empty()) {
    int now = q.front();
    q.pop();
    int size = vec[now].size();
    for (int i = 0; i < size; i++) {
      int nn = vec[now][i];
      if (vis[nn] == 0) {
        vis[nn] = 1;
        q.push(nn);
      }
      if (nn == 1) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
