Hotels on the Caspian Coastline#286

Hotels on the Caspian Coastline

1 second
128 megabytes
Easy (≈1000)

Along the beautiful Caspian coastline, there are hotels. Each hotel has a price in manats. Emrah has won manats in the lottery. Now he wants to select a contiguous sequence of hotels such that the sum of their prices is as large as possible but does not exceed .

You need to calculate this maximum possible total price.

Input

The first line contains two integers and m~(1 \le n \le 3 \cdot 10^5, 1 \le m < 2^{31}). The next line contains positive integers representing the prices of the hotels along the coast, and these prices are less than 10^6.

Output

Print the required maximum price (this value will be greater than for all tests).

Examples

Example 1

Loading
Loading