#include <bits/stdc++.h>
using namespace std;
const int N = 5000010;
vector<long long> v[N];
int a[N];
long long com2(long long n) { return n * (n - 1) / 2; }
int main() {
  long long n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] >= m) {
      printf("0\n");
      return 0;
    }
  }
  for (int i = 1; i <= n; i++)
    if (a[i]) {
      for (int j = i; j <= n; j++) v[0].push_back(a[j]);
      break;
    }
  if (v[0].size() == 2) {
    long long lt = 1, rt = m / v[0][0] + 1, mid;
    long long ans = 0;
    while (lt <= rt) {
      mid = (lt + rt) >> 1;
      if (1LL * mid * v[0][0] + v[0][1] >= m)
        ans = mid, rt = mid - 1;
      else
        lt = mid + 1;
    }
    cout << ans << endl;
  } else if (v[0].size() == 3) {
    long long lt = 1, rt = 2000000000, mid;
    long long ans = 0;
    while (lt <= rt) {
      mid = (lt + rt) >> 1;
      long long p = com2(mid + 1);
      if (m / v[0][0] < p) {
        ans = mid, rt = mid - 1;
        continue;
      }
      p = p * v[0][0] + mid * v[0][1] + v[0][2];
      if (p >= m) {
        ans = mid, rt = mid - 1;
      } else
        lt = mid + 1;
    }
    cout << ans << endl;
  } else {
    for (int i = 1; i < N; i++) {
      long long sum = 0;
      for (int j = 0; j < v[i - 1].size(); j++) {
        sum += v[i - 1][j];
        v[i].push_back(sum);
        if (sum >= m) {
          printf("%d\n", i);
          return 0;
        }
      }
    }
  }
  return 0;
}
