408755: GYM103295 C Bugged Sum
Description
Metal Guy is trying to create an artificial intelligence to help him process information and act as a personal assistant, but his current program has a bug! If any pair of integers sum up to a certain bugged number, the training program crashes and he must start over.
He realizes that he could simply process the data multiple times in separate sessions to avoid running into this issue. However, he's very impatient and only wants to have at most two sessions. Can he separate his data set into two such that no two numbers will sum up to the bugged number?
InputOn the first line, two integers: $$$1 \leq N \leq 10^6$$$ and $$$1 \leq S \leq 10^9$$$, indicating the size of the dataset and bugged number respectively. One the next line, $$$N$$$ integers $$$1 \leq a_i \leq 10^9$$$ representing the data set.
OutputOne line with yes if he can separate the set into two, each without a pair summing to $$$S$$$, no otherwise (case insensitive).
ExamplesInput5 6 1 2 3 4 5Output
yesInput
8 6 1 1 1 1 3 3 3 3Output
no