#include <bits/stdc++.h>
using namespace std;
bool cmp(const string &a, const string &b) { return a.size() < b.size(); };
string ToString(long long n) {
  string ret = "";
  while (n > 0) {
    ret += (n % 10) + '0', n /= 10;
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
const int N = 50000 + 1, mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, arr[3 * 10000 + 1];
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    cin >> arr[i];
  }
  if (n == m) return cout << "YES", 0;
  for (int i = 1; i < n; i++) {
    if (i == m) return cout << "YES", 0;
    i += arr[i] - 1;
  }
  cout << "NO";
  return 0;
}
