For this Question: You are given an N*M grid with you standing at the upper left corner(0,0). You want to reach  lower right(N-1,M-1) cell and you can only move down  or right. Find the Number of ways you can do so. Note that B places on the grid are blocked and you cannot step there. As the answer may be large so print anwer modulo 1000000007.First line contains N M B. 
B lines follow each containing coordinate of the ith blocked cell Xi Yi.

2 <= N,M <= 100
0 <= B <= N*M - 2 (start and end cell will never be blocked)
0 <= X <= N-1
0 <= Y <= M-1Output single integer containing the number of possible paths modulo 1000000007.Sample Input
2 2 0

Sample Output
2

Sample Input
2 2 1
0 1

Sample Output
1, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {

	static long mod = (long) 1e9+7;


	static long numberOfWays(int[][] grid, int m, int n){

		long[][] dp = new long[m][n];
		if(grid[0][0] == 0){
			dp[0][0] = 1;
		}
		for(int i = 1; i < m; i++){
			if(grid[i][0] == 0){
				dp[i][0] = dp[i-1][0];
			}
		}
		for(int j = 1; j < n; j++){
			if(grid[0][j] == 0){
				dp[0][j] = dp[0][j-1];
			}
		}
		for(int i = 1; i < m; i++){
			for(int j = 1; j < n; j++){
				if(grid[i][j] == 0){
					dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % mod;
				}
			}
		}
		return dp[m-1][n-1];
	}




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