#include <bits/stdc++.h>
using namespace std;
int n, t;
int f[30100];
bool take[30100], sol;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> t;
  for (int i = 1; i < n; i++) cin >> f[i];
  int i = 1;
  while (!take[i]) {
    take[i] = true;
    i = i + f[i];
    if (i == t) {
      sol = true;
      break;
    }
  }
  cout << (sol ? "YES" : "NO") << '\n';
}
