#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll mod=1000000007;
int main()
{
    ll i,j,k,l,m,n;
    cin>>m>>n;
    string s[m];
    for(i=0;i<m;i++)
        cin>>s[i];
    ll arr[m+1][n+1];
    memset(arr,0,sizeof arr);
    arr[0][1]=1;
    for(i=1;i<=m;i++)
        for(j=1;j<=n;j++)
            (s[i-1][j-1]=='.')?arr[i][j]=(arr[i-1][j]+arr[i][j-1])%mod:arr[i][j]=0;
    cout<<arr[m][n]<<endl;


}
