#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-12;
const long long int mod = 1e9 + 7;
bool comp(pair<long long int, pair<long long int, long long int>> n1,
          pair<long long int, pair<long long int, long long int>> n2) {
  return n1.first > n2.first;
}
int main() {
  long long int n, t;
  cin >> n >> t;
  long long int a[n];
  for (long long int i = 1; i < n; i++) cin >> a[i];
  long long int cur = 1;
  while (cur <= t) {
    if (cur == t) return cout << "YES", 0;
    cur += a[cur];
  }
  cout << "NO";
}
