#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, n, m, x, y, ar[1003], br[1003], sz, i, j, fl = 0, ans = 0,
                                                            mx = 0, cnt = 0;
  string s, s1, s2;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> x;
    m = m - (86400 - x);
    if (m < 1 && fl == 0) {
      fl = 1;
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
