/*
                       _oo0oo_
                      o8888888o
                      88" . "88
                      (| -_- |)
                      0\  =  /0
                    ___/`---'\___
                  .' \\|     |// '.
                 / \\|||  :  |||// \
                / _||||| -:- |||||- \
               |   | \\\  -  /// |   |
               | \_|  ''\---/''  |_/ |
               \  .-\__  '-'  ___/-. /
             ___'. .'  /--.--\  `. .'___
          ."" '<  `.___\_<|>_/___.' >' "".
         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
         \  \ `_.   \_ __\ /__ _/   .-` /  /
     =====`-.____`.___ \_____/___.-`___.-'=====
                       `=---='
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  Vikash Kumar @ Codechef/codeforces 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/   
#include<bits/stdc++.h>
 
#define ll                    long long int
#define ll_MAX		      	  LLONG_MAX
#define ll_MIN		          LLONG_MIN
#define loop(i,a,b)           for(int i=(int)a;i<(int)b;++i)
#define rloop(i,a,b)          for(int i=(int)a;i<=(int)b;++i)
#define loopl(i,a,b)          for(ll i=(ll)a;i<(ll)b;++i)
#define loopr(i,a,b)          for(int i=(int)a;i>=(int)b;--i)
#define count_1(n)            __builtin_popcountll(n)
#define pb                    push_back
#define eb                    emplace_back
#define ab(a)                 (a<0)?(-1*a):a
#define mset(a,b,c)           loop(i,0,b) a[i]=c
#define F                     first
#define S                     second
//#define mp                    make_pair
#define clr(x)                x.clear()
#define MOD                   1000000007
#define MAX                   1e9
#define MIN                   -1e9
#define itoc(c)               ((char)(((int)'0')+c))
#define vi                    vector<int>
#define vvi                   vector<vi>
#define pll                   pair<ll,ll>
#define pii                   pair<int,int>
#define all(p)                p.begin(),p.end()
//#define max(x,y)              (x>y)?x:y
//#define min(x,y)              (x<y)?x:y
#define mid(s,e)              (s+(e-s)/2)
#define mini                  INT_MIN
const int MX=10010896;
const int lmt=3164;
const int N=10000001;
int flag[MX>>6];
#define ifc(i)                (flag[i>>6]&(1<<((i>>1)&31)))
#define isc(i)                (flag[i>>6]|=(1<<((i>>1)&31)))
#define chk(n)                (n==2||(n>2&&(n&1)&&!ifc(n)))
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
ll extgcd(ll a,ll b,ll& x,ll& y){if(b==0){x=1;y=0;return a;}else{int g=extgcd(b,a%b,y,x);y-=a/b*x;return g;}}
ll modpow(ll a,ll b) {ll res=1;a%=MOD;for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
void sieve(){ int i,j,k; for(i=3;i<lmt;i+=2) if(!ifc(i)) for(j=i*i,k=i<<1;j<MX;j+=k) isc(j);}

const ll NN=1005;
char mat[NN][NN];
ll dp[NN][NN];

void fill_dp(ll r,ll c){
  for(ll i=0;i<r;i++){
    for(ll j=0;j<c;j++){
      if(mat[i][j]=='#')continue;
      ll u=(i-1>=0)?dp[i-1][j]:0;u=u%MOD;
      ll l=(j-1>=0)?dp[i][j-1]:0;l=l%MOD;
      dp[i][j]+=(u+l)%MOD;
      //cout<<"dp["<<i<<"]["<<j<<"]: "<<dp[i][j]<<endl;
    }
  }
}

inline void solve(){
    /*_Start_*/
	ll r,c;cin>>r>>c;
	//memset(mat,'-',sizeof(mat));
	for(ll i=0;i<r;i++){
		string s;cin>>s;
		for(ll j=0;j<c;j++){
			mat[i][j]=s[j];
		}
	}
  for(ll i=0;i<r;i++){
    for(ll j=0;j<c;j++){
      dp[i][j]=0;
      //cout<<"dp["<<i<<"]["<<j<<"]: "<<dp[i][j]<<endl;
    }
  }
  dp[0][0]=1;
  fill_dp(r,c);
  cout<<(dp[r-1][c-1])%MOD<<endl;


    /*_End_*/
   
}

int main()
{
	cout<<fixed<<setprecision(12);
	//freopen("input.txt", "r", stdin);
	fastio;ll  t=1,tc=1;
	//cin>>t;
	while(t--){solve();}return 0;
}

Measured memory_bytes: 9088