#include <bits/stdc++.h>
using namespace std;
int n, t;
bool ans = 0;
vector<int> port;
vector<bool> f;
void dfs(int i) {
  if (i == t - 1) {
    ans = 1;
    return;
  }
  f[i] = 1;
  if (i != n - 1 && !f[i + port[i]]) dfs(i + port[i]);
}
int main() {
  cin >> n >> t;
  port.resize(n - 1);
  f.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    cin >> port[i];
  }
  dfs(0);
  cout << (ans ? "YES" : "NO");
  return 0;
}
