Under construction

Still being built. Things may change

Velsas

Interview

Time limit1sMemory limit1024 MB

Summary
Find the shortest contiguous run of daily route heights whose sum is at least M, or report NEPAVYKS if no such run exists.
Level

Easy3 of 10

Topics
Sliding window, Two pointers, Array
Solved
No attempts yet

Problem

Every spring, Vladimir travels to Wales with his friends to ride bicycles.

Wales has beautiful nature. It has fast rivers, forests untouched by people, waterfalls, and mountains.

To ride in mountainous terrain, Vladimir must train. He planned a route of a fixed height for each day.

Vladimir is ready once the sum of the heights of the routes he has completed is at least MM meters.

If he trains without breaks, find the minimum number of days he needs to get ready for the trip. Vladimir may start training on any day.

Input

The first line contains two integers NN and MM. NN is the number of days, and MM is the sum of route heights Vladimir wants.

Each of the next NN lines contains one integer mim_i, the height in meters of the route planned for that day.

Output

Print one integer: the minimum number of days Vladimir needs to get ready, if he trains without breaks.

If he cannot get ready, print NEPAVYKS.

Constraints

  • 1≤N≤200 0001 \le N \le 200\,000
  • 1≤M≤1 000 000 0001 \le M \le 1\,000\,000\,000
  • 0≤mi≤1 000 000 0000 \le m_i \le 1\,000\,000\,000

Examples2

  1. Example 1

    Input
    7 10
    8
    1
    1
    3
    5
    7
    1
    
    Expected output
    2
    
  2. Example 2

    Input
    2 20
    1
    1
    
    Expected output
    NEPAVYKS