For this Question: Given the scores of a cricket player in n innings and a target score k, you can choose an inning score x from the list, erase x from the list, and subtract the value of x from all the remaining innings scores. Find if there is a sequence of n-1 operations such that, after applying the operations, the only remaining inning score is equal to a target score k.The first line contains two integers n and k, the number of integers in the list, and the target value, respectively.
The second line contains the n innings a<sub>1</sub>, a<sub>2</sub>, a<sub>3</sub>...a<sub>n</sub>.

<b>Constraints </b>
2 &le; n &le; 2*10<sup>5</sup>
1 &le; k &le; 10<sup>9</sup>
-10<sup>9</sup> &le; a[i] &le; 10<sup>9</sup>Print "YES" if there is some sequence of n−1 operations such that, after applying the operations, the only remaining inning score is equal to k. Else print "NO".Input:
4 5
4 2 2 7
Output:
YES
Explanation :
We have the list {4, 2, 2, 7}, and we have the target k=5. One way to achieve it is the following: first, we choose the third element, obtaining the list {2, 0, 5}. Next, we choose the first element, obtaining the list {−2, 3}. Finally, we choose the first element, obtaining the list {5}., I have written this Solution Code: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
 
int main() {
    int t;
    t=1;
    while(t--) {
        int n, a;
    	cin >> n >> a;
    	vector<int> v(n);
    	for(int& x : v) cin >> x;
    	bool ans = false;
    	if(n == 1) ans = (v[0] == a);
    	else {
    		sort(v.begin(), v.end());
    		int i = 0;
    		int j = 1;
    		while(j < n and i < n) {
    			if(v[i] + abs(a) == v[j]) {
    				ans = true;
    				break;
    			}
    			else if(v[i] + abs(a) < v[j]) ++i;
    			else ++j;
    		}
    	}
    	cout << (ans? "YES" : "NO") << '\n';   
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?