#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define all(x) x.begin(),x.end()
#define v(x) vector<x>
#define nl '\n'
ll mod = 1e9+7;
int h;
vector<vector<char>> grid(1001,vector<char> (1001));
vector<vector<ll>> dp(1001,vector<ll> (1001,-1));

ll CountWays(ll r , ll c)
{
    // base
    if(r > h-1 or c > h-1 or grid[r][c] == '*') return 0;
    if(r == h-1 and c == h-1) return 1;

    // dp
    if(dp[r][c] != -1) return dp[r][c];


    return dp[r][c] = (CountWays(r+1,c)%mod + CountWays(r,c+1)%mod)%mod;
}


int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    cin >> h;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < h; j++)
        {
            cin >> grid[i][j];
        }
        
    }
    
    cout << CountWays(0,0);
}