#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, no, t;
  cin >> n >> t;
  vector<int> a;
  for (i = 0; i < n; i++) {
    cin >> no;
    a.push_back(no);
  }
  int sum = 0;
  for (i = 0; i < n; i++) {
    sum = ((i + 1) + a[i]);
    if (sum > t) {
      cout << "NO\n";
      break;
    }
    if (sum == t) {
      cout << "YES\n";
      break;
    }
    i = sum - 2;
  }
}
