#K66917. Pair Sum Check

    ID: 32527 Type: Default 1000ms 256MiB

Pair Sum Check

Pair Sum Check

In this problem, you are given a list of integers and a target integer TT. Your task is to determine whether there exists a pair of distinct elements in the list such that their sum equals TT, i.e., whether there exist indices ii and jj with iji \neq j such that $$a_i + a_j = T.$$

Input consists of an integer NN (the number of integers) and an integer TT on the first line, followed by NN integers on the second line. Output "YES" if such a pair exists, otherwise output "NO".

inputFormat

The first line of input contains two space-separated integers: NN (the number of elements) and TT (the target sum). The second line contains NN space-separated integers representing the list.

outputFormat

Output a single line containing “YES” if there exists a pair of integers in the list whose sum is equal to TT, otherwise output “NO”.## sample

5 9
2 7 11 15 3
YES