#include <bits/stdc++.h>
using namespace std;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl





using ll = long long;


const ll mod = 1e9+7;
const int maxn = 2e3 + 10;


int n, m;
int g[maxn][maxn];
ll dp[maxn][maxn];



void add(ll &x, ll y) {
    x %= mod;
    y %= mod;
    x += y;
    x %= mod;
}


ll L[maxn];
ll U[maxn];
ll D[maxn+maxn];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);

    cin>>n>>m;
    for (int i=1; i<=n; i++) {
	string s;
	cin>>s;
	for (int j=1; j<=m; j++) {
	    if (s[j-1]=='#') g[i][j]=1;
	}
    }
    

    dp[1][1]=1;
    for (int i=1; i<=n; i++) {
	for (int j=1; j<=m; j++) {
	    if (g[i][j] == 0) {
		add(dp[i][j], U[j]);
		add(dp[i][j], L[i]);
		add(dp[i][j], D[i-j+maxn]);

		add(U[j], dp[i][j]);
		add(L[i], dp[i][j]);
		add(D[i-j+maxn], dp[i][j]);

	    } else {
		U[j] = 0;
		L[i] = 0;
		D[i-j+maxn] = 0;
	    }
	}
    }

    ll res = dp[n][m];
    res %= mod;
    res += mod;
    res %= mod;
    out(res);    
    return 0;
}

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)

constexpr unsigned MOD = 1000000007;

inline void add(unsigned &x, const unsigned &y) {
    if (x + y >= MOD * 2) x = x + y - MOD * 2;
    else if (x + y >= MOD) x = x + y - MOD;
    else x += y;
}

int main()
{
    cin.tie(nullptr), ios::sync_with_stdio(false);

    int H, W;
    cin >> H >> W;

    vector<unsigned> dp(W);
    vector<unsigned> dpu(W);
    vector<unsigned> dpn(W);
    dp[0] = 1;
    while (H--) {
        string S;
        cin >> S;
        vector<unsigned> nxt(W), dpr(W), nxtu(W), nxtn(W);
        REP(j, W) {
            if (S[j] == '#') {
                continue;
            }
            if (j + 1 < W) {
                add(dp[j + 1], dp[j] + dpr[j]);
                add(dpr[j + 1], dp[j] + dpr[j]);
                add(nxt[j + 1], dp[j] + dpn[j]);
                add(nxtn[j + 1], dp[j] + dpn[j]);
            }
            add(nxt[j], dp[j] + dpu[j]);
            add(nxtu[j], dp[j] + dpu[j]);
        }
        if (H == 0) {
            cout << dp.back() << '\n';
            return 0;
        }
        dp = nxt, dpu = nxtu, dpn = nxtn;
    }
}
