#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, t;
  cin >> n >> t;
  long long int i, a, c, ans, k = 0, f = 0;
  for (i = 0; i < n; i++) {
    cin >> a;
    c = 86400 - a;
    if (a == 0) {
      c = 86400;
    }
    k += c;
    if (k >= t && f == 0) {
      ans = i + 1;
      f = 100;
    }
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  cout << ans;
  return 0;
}
