#include <bits/stdc++.h>
int main(void) {
  int n, t, c, f;
  scanf("%d %d", &n, &t);
  c = 1;
  while (c < t) {
    scanf("%d", &f);
    c += f;
    while (--f) scanf("%*d");
  }
  puts(c == t ? "YES" : "NO");
  return 0;
}
