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: 
#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 1001
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int solve(int n){
int cnt=0;
int p=sqrt(n);
for(int i=1;i<=p;i++){
    if(n%i==0){
        cnt++;
        if(i*i!=n){cnt++;}
    }

}
return cnt;
}

 bool dp[max1][max1];
vector<int> v;
signed main(){

         int n;
         cin>>n;
         int sum=0;
         int a[n];
         FOR(i,n){
         cin>>a[i];

         sum+=a[i];}
         //out(sum);
         if(sum&1){out("NO");return 0;}
         sum/=2;

    for (int i = 0; i <= n; i++)
        {dp[i][0] = true;}

    for (int i = 1; i <= sum; i++)
       { dp[0][i] = false;}

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= sum; j++) {
            if (j < a[i - 1]){
                dp[i][j] = dp[i - 1][j];}
            if (j >=a[i - 1]){
                dp[i][j] = dp[i - 1][j]
                               || dp[i - 1][j - a[i - 1]];}
        }
    }

    if(dp[n][sum]){out("YES");}
    else{
        out("NO");
    }
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?