#include <bits/stdc++.h> #include #include #include #include #include #include #include #include using namespace std; int n, b, sum; int a[10000000]; int main() { cin >> n >> b; for (int i = 1; i <= n; i++) { cin >> a[i]; } for (int i = 1; i <= n; i++) { sum += a[i]; if (sum >= b) { cout << i; return 0; } } cout << -1; }