#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e4;
vector<int> v[MAXN];
int n, t;
bool flag[MAXN], flag2;
void dfs(int a) {
  flag[a] = true;
  for (int i = 0; i < v[a].size(); i++) {
    if (flag[v[a][i]] == false) {
      if (v[a][i] == t) flag2 = true;
      dfs(v[a][i]);
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> t;
  for (int i = 1; i <= n - 1; i++) {
    int a;
    cin >> a;
    v[i].push_back(a + i);
  }
  dfs(1);
  if (flag2 == true) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
}
