#define _DEBUG
//ヘッダー
#include<bits/stdc++.h>
using namespace std;

//型定義
typedef long long ll;

//定数
const ll INF=1e+18;
const int MOD=1e+9+7;

//デバッグ
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug1(x1) cout<<#x1<<": "<<x1<<endl
#define debug2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#ifdef _DEBUG
#define debug(...) CHOOSE((__VA_ARGS__,debug5,debug4,debug3,debug2,debug1,~))(__VA_ARGS__)
#else
#define debug(...)
#endif

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値

//省略
using vi  = vector<int>;
using vii = vector<vector<int>>;
using vl  = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(){
    ll H,W;
    cin>>H>>W;
    vector<vector<char>> S(H+2,vector<char>(W+2,'#'));
    REP(i,H){
        REP(j,W){
            cin>>S[i+1][j+1];
        }
    }

    vll dp(H+2,vl(W+2,0)),L(H+2,vl(W+2,0)),U(H+2,vl(W+2,0)),naname(H+2,vl(W+2,0));

    dp[1][1]=1;
    L[1][1]=1;
    U[1][1]=1;
    naname[1][1]=1;
    REP2(i,1,H+1){
        REP2(j,1,W+1){
            if(S[i][j]=='#'){
                dp[i][j]=0;
                L[i][j]=0;
                U[i][j]=0;
                naname[i][j]=0;
            }else{
                dp[i][j]+=L[i][j-1];
                dp[i][j]%=MOD;
                dp[i][j]+=U[i-1][j];
                dp[i][j]%=MOD;
                dp[i][j]+=naname[i-1][j-1];
                dp[i][j]%=MOD;

                L[i][j]=L[i][j-1]+dp[i][j];
                L[i][j]%=MOD;
                U[i][j]=U[i-1][j]+dp[i][j];
                U[i][j]%=MOD;
                naname[i][j]=naname[i-1][j-1]+dp[i][j];
                naname[i][j]%=MOD;
            }
        }
    }
    cout<<dp[H][W]<<endl;

}
#include<bits/stdc++.h>
using namespace std;
using u64 = uint_fast64_t;
using u32 = uint_least32_t;
using u16 = uint_least16_t;
using u8 = uint_least8_t;

int main(void) {

	u32 mod = 1000000007;

	u16 H, W;
	cin >> H >> W;

	u32 dp;
	vector<u32> vdp(W);
	u32 hdp;
	vector<u32> ddp(W);

	for(u16 i=0; i<H; ++i) {
		u32 t_ddp = ddp[0];

		for(u16 j=0; j<W; ++j) {
			u8 c;
			cin >> c;

			if(c == '#') {
				dp = 0;
				vdp[j] = 0;
				hdp = 0;
				t_ddp = ddp[j];
				ddp[j] = 0;
			} else if(i == 0 && j == 0) {
				dp = 1;
				vdp[j] = 1;
				hdp = 1;
				t_ddp = ddp[j];
				ddp[j] = 1;
			} else if(i == 0) {
				dp = hdp;
				vdp[j] = dp;
				hdp = (hdp + dp) % mod;
				t_ddp = ddp[j];
				ddp[j] = dp;
			} else if(j == 0) {
				dp = vdp[j];
				vdp[j] = (vdp[j] + dp) % mod;
				hdp = dp;
				t_ddp = ddp[j];
				ddp[j] = dp;
			} else {
				dp = ((vdp[j] + hdp) % mod + t_ddp) % mod;
				vdp[j] = (vdp[j] + dp) % mod;
				hdp = (hdp + dp) % mod;
				u32 k_ddp = t_ddp;
				t_ddp = ddp[j];
				ddp[j] = (k_ddp + dp) % mod;
			}
		}
	}

	cout << dp << endl;
	return 0;
}
