// Arup Guha
// 11/12/2026
// Illustration of Grid Walking (Counting paths)
// Grid Paths on CSES
// https://cses.fi/problemset/task/1638/

import java.util.*;

public class gridpaths {

	public static void main(String[] args) {
	
		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();
		
		// Stores best value (most pages) for price i.
		int[][] dp = new int[n][n];
		
		// Initialize first row.
		int cur = 1;
		for (int i=0; i<n; i++) {
			if (g[0][i] == '*') cur = 0;
			dp[0][i] = cur;
		}
		
		// Same for first column.
		cur = 1;
		for (int i=0; i<n; i++) {
			if (g[i][0] == '*') cur = 0;
			dp[i][0] = cur;
		}
		
		// Go to each square.
		for (int i=1; i<n; i++)
			for (int j=1; j<n; j++)
				
				// We only add if this is a valid square.
				if (g[i][j] != '*')
					
					// Don't forget the mod, lol!
					dp[i][j] = (dp[i-1][j] + dp[i][j-1])%1000000007;
					
		// Ta da!
		System.out.println(dp[n-1][n-1]);
	}
}