Considering the above conditions true , check if XOR of S ^ ( S - X ) is X or not
if ( N == 2 ) { int C = ( S - X ) / 2 ; int A = C ; int B = C ; A = A + X ; if ( ( ( A ^ B ) == X ) ) { return " Yes " ; } else { return " No " ; } } } else { return " No " ; } }