// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long

#define ull unsigned long long

#define IO ios::sync_with_stdio(false), cin.tie(0)

#define endl '\n'

#define main() int main()

#define ff1(i,n) for(int i=1;i<=n;++i)

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

#define pi acos(-1.0)

#define ms(a, x) memset(a, x, sizeof(a))

#define lowbit(x) ((x)&(-(x)))

#define pb push_back

#define binarycount __builtin_popcount(x)

#define tr t[root]

#define lson t[root << 1]

#define rson t[root << 1 | 1]

#define fir first

#define sec second

#define debug(x) cout<<x<<'\n'

#define sa(a) scanf("%d", &a)

#define sab(a, b) scanf("%d%d", &a, &b)

#define pa(a) printf("%d",a)

#define pab(a,b) printf("%d%d",a,b)

#define pii pair<string,int>

using namespace std;

#define maxn 1005

const int inf = 0x3f3f3f3f;

const int mod = 1e9+7;

const double eps = 1e-8;

ll gcd(ll a, ll b) {return b==0?a:gcd(b, a%b);}

ll lcm(ll a, ll b) {return a/gcd(a, b)*b;}

int max(int x,int y){if(x>y) return x;return y;}

ll powmod(ll a,ll b){

    ull ans = 1, pow = a%mod;

    while(b) { if(b&1) ans = (ans*pow)%mod; pow = (pow*pow)%mod; b >>= 1; }

    return ans%mod;

}



int n,m;

char mp[maxn][maxn];

int dp[maxn][maxn];

main()

{

	IO;

	cin>>n>>m;

	ms(dp,0);

	for(int i=1;i<=n;i++)

		for(int j=1;j<=m;j++)

		 cin>>mp[i][j];

		 

	for(int i=1;i<=n;i++){

		if(mp[i][1]=='#')break;

		dp[i][1]=1;

	}	 

	for(int i=1;i<=m;i++){

		if(mp[1][i]=='#')break;

		dp[1][i]=1;

	}

	for(int i=2;i<=n;i++)

	{

		for(int j=2;j<=m;j++)

		{

			if(mp[i][j]=='#')continue;

			if(mp[i-1][j]!='#'){

				dp[i][j]=(dp[i][j]+dp[i-1][j])%mod;

			}

			if(mp[i][j-1]!='#'){

				dp[i][j]=(dp[i][j]+dp[i][j-1])%mod;

			}

		}

	}



	cout<<dp[n][m]%mod<<endl;

	

}


// Faster C++ solution for the same problem (measured speedup: 5.1426570102459515x):
#include<bits/stdc++.h>

#define int long long

#define ll long long

#define ld long double

#define mod ((ll)1e9+7)

#define maxx ((ll)1e6+5)

#define pb push_back

#define ins insert

#define usefile freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);

#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define test ll t; cin>>t; while(t--)

ll exp(ll x,ll y,ll p){ ll res=1; while(y) {if(y%2) res=(res*x%p)%p; x=(x*x)%p; y/=2; } return res;}

ll expo(ll x,ll y){ ll res=1; while(y) {if(y%2) res=(res*x%mod)%mod; x=(x*x)%mod; y/=2; } return res;}

/*int sv[1000000]={0};

ll fact[1000007]={0};

void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}

void sve() {sv[0]=1;sv[1]=1;for(int i=2;i*i<=maxx;i++){if(!sv[i]){for(int j=2*i;j<=maxx;j+=i)sv[j]=1;}}}//0 hai to prime

ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(expo(fact[r],mod-2)))%mod; res=(res*(expo(fact[n-r],mod-2)))%mod; return res;}

ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(expo(fact[n-r],mod-2)))%mod; return res;}*/

int d[1003][1003];

using namespace std;

signed main()

{

    int r,c,i,j;

    cin >> r >> c;

    char a[r][c];

    for(i=0 ; i<r ; i++)

    	for(j=0 ; j<c ; j++)

    		cin >> a[i][j];

    d[0][0] = 1;

    for(i=0 ; i<r ; i++)

    	for(j=0 ; j<c ; j++)

    	{

    		if(a[i][j] == '#')

    			continue;

    		if(j>0) d[i][j] = (d[i][j] + d[i][j-1])%mod;

    		if(i>0) d[i][j] = (d[i][j] + d[i-1][j])%mod;

    	}

    cout << d[r-1][c-1] <<"\n";

    return 0;

}