// Arup Guha
// 4/2/2024
// Solution to CSES Problem: Grid Paths

import java.util.*;
 
public class gridpath {
 
	public static void main(String[] args) {
	
		// Read the grid.
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		char[][] g = new char[n][];
		for (int i=0; i<n; i++)
			g[i] = stdin.next().toCharArray();
			
		// Set up DP array. First row and column are easy.
		int[][] dp = new int[n][n];
		int cur = 1;
		for (int i=0; i<n; i++) {
			if (g[0][i] == '*') cur = 0;
			dp[0][i] = cur;
		}
		cur = 1;
		for (int i=0; i<n; i++) {
			if (g[i][0] == '*') cur = 0;
			dp[i][0] = cur;
		}
		
		// Go through each grid square.
		for (int i=1; i<n; i++) {
			for (int j=1; j<n; j++) {
				if (g[i][j] == '*') continue;
				
				// Add from the two squares we could come from.
				dp[i][j] = (dp[i-1][j]+dp[i][j-1])%1000000007;
			}
		}
		
		// Ta da!
		System.out.println(dp[n-1][n-1]);
	}
}