For this Question: Given a 2-D matrix with M rows and N columns, find the number of ways to reach cell with coordinates (M-1,N-1) from starting cell (0,0) under the condition that you can only travel one step right or one step down.The first line of every test case consists of M and N, denoting the number of rows and number of column respectively.

Constraints
1<= M,N <=1000Single line output i.e count of all the possible paths from top left to the bottom right of a mxn matrix. Since the output can be very large number use modulo 10^9+7.Sample Input:
3 3

Sample Output:
6

Explanation:
(0,0) -> (0,1) -> (0, 2) -> (1, 2) -> (2, 2) -> (2, 3) -> (3, 3) is one of the ways, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	static long check(int m, int n)
	{
		long mod=1000000007;
		long[] dp = new long[n];
		dp[0] = 1;

		for (int i = 0; i < m; i++) {
			for (int j = 1; j < n; j++) {
				dp[j] = (dp[j] + dp[j - 1])%mod;
			}
		}
		return dp[n - 1] %mod;
	}
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int n=sc.nextInt();
        System.out.println(check(m,n));
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?