 #include<bits/stdc++.h>
 using namespace std;
 typedef long long ll;
 ll mod=(ll)1e9+7;
 ll dp[1002][1002]; 
 int main(){
  ll m,i,n,j;
  cin>>n>>m;
  vector<string > v(n);
  for(i=0;i<n;i++)
   cin>>v[i];
  for(i=0;i<=n;i++)
   for(j=0;j<=m;j++)
    if(i==0||j==0||v[i-1][j-1]=='#')dp[i][j]=0;
    else if(i==1&&j==1)dp[i][j]=1;
    else dp[i][j]=(dp[i-1][j]+dp[i][j-1])%mod;
  cout<<dp[n][m];     
 }