For this Question: Chef is playing with a number N. If the total number of set bits in N is even then Chef is happy. Determine whether Chef is happy or not.first line contain a single integer N.if the total number of set bits in N is even print "Yes" otherwise print "No"Sample Input 1:
7

Sample Output 1:
NO

Sample Input 2:
24

Sample Output 1:
Yes, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) {

		try{
			InputStreamReader r = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(r);
			int n = Integer.parseInt(br.readLine());
			int count = 0;
			int mask = 1;
			for(int i = 0;i<32;i++){
				if((n&mask)>0){
					count++;
				}
				mask = mask<<1;
			}
			System.out.print((count ^ 1) == count + 1 ?"Yes":"No");

		}catch(Exception e){

		}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?