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: 
def subsets(arr, n):
	arr.sort()
	set1 = 0
	set2 = 0
	for i in range(n-1, -1, -1):

		if(set1 < set2):
			set1 += arr[i]
		else:
			set2 += arr[i]

	if(set1 == set2):
		print('YES')
	else: 
		print('NO')				

n=int(input())
arr = list(map(int, input().split()))
subsets(arr, n), In this Programming Language: Python, Now tell me if this Code is compilable or not?