For this Question: Given a group of A + B people, with A Indians and B Americans. Find number of ways to select a non-empty subset of these people, such that the subset has equal number of Indian and American people.Input contains two space separated integers A and B.

Constraints: 
1 <= A, B <= 1000000Print the number of ways modulo 1000000007.Sample Input 
2 2

Sample Output
5

Explanation: (I1, A1) (I2, A1) (I1, A2) (I2, A2) (I1, I2, A1, A2)
I denotes indian person. A denotes american person., I have written this Solution Code: 




import java.io.*;

public class Main {
    static long mod = 1000000007;
    static long[] dp = new long[1000001];
    static{
        dp[0] = 1;
        for(int i = 1 ; i < 1000001 ; i++){
            dp[i] = (dp[i - 1] * i)%mod;
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] line = br.readLine().split(" ");
        int ind = Integer.parseInt(line[0]);
        int amer = Integer.parseInt(line[1]);
        computemaxPossibilies(ind, amer);
    }


    static void computemaxPossibilies(int ind, int amer){
        long result =0;
        int min = Math.min(ind,amer);



        for(int i = 1 ;  i <= Math.min(ind,amer) ; i++){
            result = (result + ((nCr(ind, i) * nCr(amer, i))%mod)%mod);
        }

        System.out.println(result%mod);
    }

    static long nCr(int n, int r){
       long result = ((((dp[n] * Fermatexponent(dp[r]) % mod) * Fermatexponent(dp[n - r])) % mod));
        return result;
    }


    static long Fermatexponent(long fact) {
        long submod = mod -2;
        long result = 1;
        while (submod > 0) {
            if (submod % 2 == 1)
                result = (result * fact) % mod;
            submod = submod / 2;
            fact = (fact * fact) % mod;
        }
        return result;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?