#include<bits/stdc++.h>
#define db double
#define ll long long
#define rep(i,x,y) for(int i=x,i##end=y;i<=i##end;++i)
#define N 2005
const int mod=1e9+7;

int h,w;
char c[2005][2005];
int dp[N][N],sum[3][N][N];

inline void reduce(int&x){
	x-=mod,x+=x>>31&mod;
}

int main(){
	std::ios::sync_with_stdio(0),std::cin.tie(0);
	std::cin>>h>>w;
	rep(i,1,h) std::cin>>c[i]+1;
	sum[0][1][1]=sum[1][1][1]=sum[2][1][1]=1;
	dp[1][1]=1;
	rep(i,1,h) rep(j,1,w){
		if(c[i][j]=='#') continue;
		if(i==1&&j==1) continue;
//		if(i>1) reduce(dp[i][j]+=sum[0][i-1][j]);
//		if(j>1) reduce(dp[i][j]+=sum[1][i][j-1]);
//		if(i>1&&j>1) reduce(dp[i][j]+=sum[2][i-1][j-1]);
//		if(i>1) reduce(sum[0][i][j]=sum[0][i-1][j]+dp[i][j]);
//		if(j>1) reduce(sum[1][i][j]=sum[0][i][j-1]+dp[i][j]);
//		if(i>1&&j>1) reduce(sum[2][i][j]=sum[2][i-1][j-1]+dp[i][j]);
		if(i>1) reduce(sum[0][i][j]=sum[0][i-1][j]+dp[i-1][j]);
		if(j>1) reduce(sum[1][i][j]=sum[1][i][j-1]+dp[i][j-1]);
		if(i>1&&j>1) reduce(sum[2][i][j]=sum[2][i-1][j-1]+dp[i-1][j-1]);
		rep(k,0,2) reduce(dp[i][j]+=sum[k][i][j]);
	}
//	rep(i,1,h) rep(j,1,w) std::cerr<<dp[i][j]<<" \n"[j==w];
	int inv=mod+1>>1;
	std::cout<<1ll*dp[h][w]*inv%mod<<'\n';
	return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
const ll md = 1e9 + 7;
int h, w;
vector<str> v;
vector<vector<ll>> way;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> h >> w;
    v.resize(h);
    for(auto &s: v) cin >> s;
    way = vector<vector<ll>>(h, vector<ll>(w, 0));
    vector<ll> rw(w, 0), clm(h, 0), dg(h+w-1, 0);
    vector<vector<int>> dg2(h, vector<int>(w, 0));
    way[0][0] = 1;
    int k1 = h-1, k2 = 0;
    ll tt = 0;
    while(k1 >= 0 && k2 < w){
        //cout << k1 << " " << k2 << " k\n";
        for(int i = k1, j = k2; i >= 0 && i < h && j >= 0 && j < w; i++, j++){
            dg2[i][j] = tt;
        }
        if(k1 == 0){
            k2++;
        }
        else k1--;
        tt++;
    }
    for(int i = 0; i < h; i++) for(int j = 0; j < w; j++){
        int dgg = dg2[i][j];
        //int dgg = 0;
        if(v[i][j] == '#'){
            rw[j] = 0;
            dg[dgg] = 0;
            clm[i] = 0;
            continue;
        }
        way[i][j]+=rw[j];
        way[i][j]%=md;
        way[i][j]+=clm[i];
        way[i][j]%=md;
        way[i][j]+=dg[dgg];
        way[i][j]%=md;
        rw[j]+=way[i][j];
        dg[dgg]+=way[i][j];
        clm[i]+=way[i][j];
        rw[j]%=md;
        clm[i]%=md;
        dg[dgg]%=md;
    }
    cout << way[h-1][w-1] <<  "\n";
}
