For this Question: Given a number N. The task is to find the Nth Catalan number.
The first few Catalan numbers for N = 1, 2, 3, … are 1, 2, 5, 14, 42, 132, 429, 1430, 4862, …

You can read more about Catalan numbers <a href="https://en.wikipedia.org/wiki/Catalan_number">here</a>.The first line of input contains a single integer T which denotes the number of test cases. The first line of each test case contains a single integer N.

Constraints:
1 <= T <= 100000
1 <= N <= 1000000For each test case, in a new line print the Catalan number at position N.

Since the answer can be large, print answer modulo (10^9 + 7)Sample Input:
3
5
4
10

Sample Output:
42
14
16796, I have written this Solution Code: import java.io.*;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        dp[0]=0;
        dp[1]=1;
        for (int i = 1; i <=1000000 ; i++) {
            dp[i+1]=(((4*i+2)%mod)*dp[i]%mod*modPow(i+2,mod-2))%mod;
        }

        while(t-->0){
            int n = Integer.parseInt(br.readLine());
            System.out.println(dp[n]);
        }

    }
    static long [] dp= new long [1000002];
    static long mod = 1000000007;
    static long modPow(long x, long n){
        if(n==0) return 1;
        if(n==1) return x;
        if(n%2==0) return modPow((x*x)%mod,n/2)%mod;
        return (x*modPow((x*x)%mod,n/2)%mod);

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