#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 2e6 + 13, M = N;
vector<int> g[N];
int arr[N];
vector<int> a;
int n, m, k;
void solve() {
  int i, j;
  cin >> n;
  int x;
  cin >> x;
  int a[n];
  for (int i = 1; i < n; i++) {
    cin >> a[i];
  }
  int cur = 1;
  bool check = false;
  for (cur = 1; cur < x; cur += a[cur])
    ;
  if (cur == x) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
