You are given N pairs (A1,B1), (A2,B2), ..., (AN,BN). You are also given an integer M.
You can swap any pair, that is, for the ith pair, Ai becomes Bi and Bi becomes Ai. You have to apply this operation in such a way that,
∑Ni=1Ai=M
Your task is to determine whether the conditions can be satisfied or not. If the condition can be satisfied, then print YES, otherwise print NO.
Input Format
Output Format
For each test case, print YES, if it is possible to satisfy the given condition, otherwise print NO.
Constraints
1≤T≤100
1≤N≤1000
1≤M≤10000
1≤Ai, Bi≤1000
It is guaranteed that the sum of values of N over all test cases in the input does not exceed 1000.
In the first test case, you can swap the 2nd pair. Thus, the sum will be 4+1=5.
In the second test case, we can show that there is no possible way to satisfy the condition.
In the third test case, there are multiple ways of satisfying the condition. One of the possible ways is to swap the 2nd and 4th pairs.