#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, d;
  cin >> n >> d;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long i = 1;
  while (i <= n && i != d) {
    i = i + a[i];
  }
  cout << (i == d ? "Yes" : "No") << endl;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
