For this Question: Given an integer array A of size N. Find whether there exist two index i and j such that i != j and A[i] = 2 * A[j].First line contains an integer N.
Next line contains N space separated integers denoting elements of array.

Constraints
1 <= N <= 10^5
1 <= Ai <= 10^5Print "YES" if there exist two index i and j which fulfil the above constraints. Otherwise print "NO".Sample Input 1:
4
10 2 5 3

Output 
YES

Explanation:
Both 5 and 10 are present in the array.

Sample Input 2:
4
7 1 13 11

Output 
NO

Explanation:
There does not exist and two indexes such that A[i] = 2 * A[j], I have written this Solution Code: import java.io.*;
import java.util.*;
class Main
{
    static boolean binary_search(int a[], int n, int l, int tar) {
	int r = n - 1;
	while (l <= r) {
		int mid = (l + r) / 2;
		if (a[mid] == tar) {
			return true;
		}
		if (a[mid] < tar)l = mid + 1;
		else r = mid - 1;
	}
	return false;
}
    public static void main (String args[]) throws IOException
    {   
        BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        int a[] = new int[n];
        String line = br.readLine();
        String[] strs = line.trim().split("\\s+");
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(strs[i]);
        }
        Arrays.sort(a);
        boolean ans = false;
    	for (int i = 0; i < n; i++) {
    		if (binary_search(a, n, i + 1, 2 * a[i])) {
    			ans = true;
    			break;
		    }
	    }
    	if (ans) {
    		System.out.print("YES");
    	}
    	else {
    		System.out.print("NO");
    	}
    }
}

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