You are given a sorted array of n integers and a target T. Decide whether there are two different positions i and j whose values add up to T.
The first line has n and T. The second line has n integers in non-decreasing order.
Print YES if such a pair exists, otherwise NO.
2 <= n <= 200000 |a_i|, |T| <= 10^9
1000 ms256 MB
5 9 1 3 4 6 8
YES
1 + 8 = 9.
4 100 1 2 3 4
NO