#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const int N=2e3+5;
const int mod=1e9+7;
ll read() 
{
	ll c=getchar(),Nig=1,x=0;
	while(!isdigit(c)&&c!='-')c=getchar();
	if(c=='-')Nig=-1,c=getchar();
	while(isdigit(c))x=((x<<1)+(x<<3))+(c^'0'),c=getchar();
	return Nig*x;
}
ll gcd(ll a,ll b)//最大公约数 
{
    return b==0?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)//最小公倍数 
{
	return a*b/gcd(a,b);
}
ll quick_pow(ll x, ll n)//快速幂 
{
    ll ans=x,dayult=1;
    dayult%=mod;
    while(n)
	{
        if(n&1)
        {
        	dayult=dayult*ans%mod;
        	n--;
		}    
        ans=ans*ans%mod;
        n>>=1;
    }
    return dayult;
}
ll extra_gcd(ll a,ll b,ll &x,ll &y)//扩展欧几里得(递归)-求逆元 
{
	if(!b)
	{
		x=1;
		y=0;
		return a;
	}
	ll exgcd=extra_gcd(b,a%b,y,x);
	y-=a/b*x;
	return exgcd;
}
ll n,m,c;
bool f[N][N];
ll dp[N][N];
ll x;
ll y[N];
ll z[N];
ll g[N];
int main()
{
	n=read();
	m=read();
	for(ll i=1;i<=n;i++)
	{
		string sz;
		cin>>sz;
		for(ll j=0;j<m;j++)	
		if(sz[j]=='.')
		{
			f[i][j+1]=1;
		}	
	}
	dp[1][1]=1;
	for(ll i=1;i<=n;i++)
	{
		x=0;
		for(ll j=1;j<=m;j++)
		{
				z[j]=g[j];
		}
		for(ll j=1;j<=m;j++)
		{
			if(i==1&&i==j)
			{
				x=1;	
				y[1]=1;	
				g[2]=1;
				continue;
			}
			if(f[i][j])
			{
				dp[i][j]=(y[j]+x+z[j])%mod;
				g[j+1]=(z[j]+dp[i][j])%mod;
				y[j]=(y[j]+dp[i][j])%mod;
				x=(x+dp[i][j])%mod;
			}
			else
			{
				dp[i][j]=0;
				x=y[j]=g[j+1]=0;
			}
		}
	}
	printf("%lld\n",dp[n][m]);
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define X ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FIXED_FLOAT(x) std::fixed <<std::setprecision(2)<<(x)
 
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
 
// long long p = 1e9+7;
 
typedef long long ll;
typedef pair<ll,ll> pl;
typedef vector<int> VI;
typedef vector<pair<ll,ll>> VP;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<bool> VB;
 
// typedef pair<ll, ll> PL;
typedef unordered_map<ll, ll> UMP;
#define FOR(i,b,init) for(i=init;i<b;i++)
#define IFOR(i,b,init) for(i=b;i>=init;i--)
#define pb push_back
#define fi first
#define se second
#define mp make_pair
 
// typedef  unordered_set<ll>;
 

/////GLOABLS VARS
ll MOD = 1e9+7;
ll MOD1 = 998244353;
ll gmx = 1e6+7; 

VL fact(gmx, 1);
//////FUNCTIONS
ll powp(ll val, ll deg)
{
    // debug(val, deg);
    if (!deg)
        return 1;
    if (deg & 1)
        return (powp(val, deg - 1) * val) % MOD;
    ll res = powp(val, deg >> 1);
    // debug(res);
    return (res * res) % MOD;
}
ll mx=1e5+7;
vector<VL> adj;
// vector<set<ll>> al(mx);
VL vis;
// ll c=1;

// set<ll> dfs(ll r){
//     if(adj[r].size()==0){al[r].insert(r);}
//     for(auto nb: adj[r]){
//         set<ll> leaves = dfs(nb);
//         for(auto leaf: leaves){
//             al[r].insert(leaf);
//         }
//     }

//     return al[r];
// }
bool dfs(ll r, ll parent){
    // debug()
    // if(igno[r]==1){return;}
    // debug(r,parent);

    if(vis[r]==1){return true;}
    if(vis[r]==2){return false;}
    vis[r]=1;
    for(auto k: adj[r]){
        if(dfs(k, r)){vis[r]=2;return true;}
    }
    vis[r]=2;
    return false;
}

//SPF
    // VL spf(mx,1);
    // FOR(i,mx,1){
    //     spf[i]=i;
    // }
    // // VL all_primes;
    // FOR(i,mx,2){
    //     if(spf[i]==i){
    //         // all_primes.pb(i);
    //         for(j=i*i;j<mx;j+=i){
    //             spf[j]=min(i, spf[j]);
    //         }
    //     }
    // }

//It is not easy but it can be fun, if you think!!!

ll gcd(ll a, ll b){
    // debug(a,b);
    if(a>b){swap(a,b);}
    if(a==0){return b;}
    return gcd(a, b%a);
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    //     #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
    // #endif


    // ll tc,ori;
    // cin>>tc;
    // while(tc--){
        string s;
        // cin>>s;
        ll n,k,m,o,x,r,y,i,a,b,j;
        cin>>n>>m;
        cout<<n/m;
        // VL l(n);
        

    // }

    

  

}