#include <bits/stdc++.h>
using namespace std;
struct compare {
  bool operator()(const int64_t& a, const int64_t& b) { return a > b; }
};
bool customS(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first) return a.second > b.second;
  return a.first < b.first;
}
bool customS2(pair<int, int> a, pair<int, int> b) {
  if ((a.first + a.second) == (b.first + b.second)) return a.second < b.second;
  return (a.first + a.second) < (b.first + b.second);
}
class CompareDist {
 public:
  bool operator()(pair<int64_t, int64_t> a, pair<int64_t, int64_t> b) {
    return a.first < b.first;
  }
};
int64_t gcd(int64_t a, int64_t b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
double gcdfloat(double a, double b) {
  if (a < b) return gcd(b, a);
  if (fabs(b) < 0.001)
    return a;
  else
    return (gcd(b, a - floor(a / b) * b));
}
int64_t LCA(int64_t a, int64_t b) {
  while (a != b) {
    if (b > a) {
      swap(a, b);
    }
    a /= 2;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t i, j, a, b, d, n, m, k, sum = 0, x, y, flag = 0, ans = 0;
  string s, newS;
  int64_t t;
  cin >> n >> t;
  vector<int> arr(n - 1);
  for (i = 0; i < (n - 1); i++) cin >> arr[i];
  int start = 1;
  while (start < t) {
    if (start == t) {
      flag = 1;
      break;
    }
    start += arr[start - 1];
  }
  if (start == t || flag == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
