#include <bits/stdc++.h>
using namespace std;
const int N = 3e4 + 200;
vector<vector<int> > k(N);
bool used[N];
bool flag = false;
int n, t;
void dfs(int u) {
  if (u == t) {
    flag = true;
    return;
  }
  for (int i = 0; i < k[u].size(); i++) {
    if (!used[k[u][i]]) {
      used[k[u][i]] = true;
      dfs(k[u][i]);
      used[k[u][i]] = false;
    }
  }
}
int main() {
  cin >> n >> t;
  for (int i = 1; i <= n - 1; i++) {
    used[i] = false;
  }
  for (int i = 1; i <= n - 1; i++) {
    int x;
    cin >> x;
    k[i].push_back(i + x);
  }
  dfs(1);
  if (flag) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
