For this Question: Given an array Arr[] of size N. Your task is to check whether you can divide the array into two subsets of equal sum.The first line of input contains a single integer N. The next line of input contains N space separated integers depicting the values of the Arr.

Constraints:-
1 <= N <= 100
1 <= Arr[i] <= 100

Note:- The sum of all elements in the array does not exceed 2000Print "YES" if the array can be divided into two subsets of equal sum else print "NO".Sample Input:-
5
1 2 3 4 6

Sample Output:-
YES

Explanation:-
(1, 3, 4) and (2, 6)

Sample Input:-
6
1 2 4 6 7 9

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



class Main {
	static boolean subsetsum(int [] arr, int s, int n){
		boolean [][] dp = new boolean [n+1][s+1];
        for(int i=0;i<=n;i++){
            dp[i][0] = true;
        }
        for(int i=1;i<=s;i++){
            dp[0][i] = false;
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=s;j++){
                if(j < arr[i-1]){
                    dp[i][j] = dp[i-1][j];
                }
                if(j >= arr[i-1]){
                    dp[i][j] = dp[i-1][j] || dp[i-1][j-arr[i-1]];
                }
            }
        }
		return dp[n][s];
	}
	public static void main (String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String [] s = br.readLine().split(" ");
		int sum = 0;
		int [] arr = new int [n];
		for(int i=0;i<n;i++){
			arr[i] = Integer.parseInt(s[i]);
			sum += arr[i];
		}
		if(sum%2 == 0){
			boolean flag = subsetsum(arr, sum/2, n);
			if(flag){
				System.out.println("YES");
			}
			else{
				System.out.println("NO");
			}
		}
		else{
			System.out.println("NO");
		}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?