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

#define REP(i,n) for(int (i)=0; i<(int)(n); i++)

const int MAXN = 1000000007;
int dp[1010][1010];
char a[1010][1010];

int main(void){
    int N,M;
    cin >> N >> M;
    REP(i,N) REP(j,M)
		cin>>a[i][j];
    dp[0][0]=1;
    REP(i,N) REP(j,M)
		if((i+j) > 0 && a[i][j] != '#')
			dp[i][j] = ((i>0?dp[i-1][j]:0)\
			+(j>0?dp[i][j-1]:0))%MAXN;
    cout << dp[N-1][M-1] << endl;
    return 0;
}
