#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<stack>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll H,W;
string s[2010];
ll vertical[2010],horizontal[2010],diagonal[4010];
int main(){
    cin>>H>>W;
    for(ll i=0;i<H;i++)cin>>s[i];

    vertical[0]=horizontal[0]=diagonal[W]=1;
    for(ll i=0;i<H;i++){
        for(ll j=0;j<W;j++){
            if(i==0 && j==0)continue;
            if(s[i][j]=='#'){
                horizontal[i]=0;
                vertical[j]=0;
                diagonal[i-j+W]=0;
                continue;
            }
            ll now=horizontal[i]+vertical[j]+diagonal[i-j+W];
            now%=MOD;
            if(i==H-1 && j==W-1){
                cout<<now<<endl;
                return 0;
            }
            horizontal[i]+=now;
            horizontal[i]%=MOD;
            vertical[j]+=now;
            vertical[j]%=MOD;
            diagonal[i-j+W]+=now;
            diagonal[i-j+W]%=MOD;
        }
    }


    return 0;
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include<bits/stdc++.h>
using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;
#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   2005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/
char a[N][N];
ll h[N][N],v[N][N],d[N][N],o[N][N],dp[N][N];
int main()
{
    ll n,m,i,j;
    cin>>n>>m;
    for1(i,n)
    {
        for1(j,m)
        {
            cin>>a[i][j];
            o[i][j] = a[i][j]=='#';
        }
    }
    h[1][1] = 1,v[1][1] = 1,d[1][1] = 1,o[1][1] = 1;
    for1(i,n)
    {
        for1(j,m)
        {
            if(o[i][j])continue;
            dp[i][j] += v[i-1][j];
            dp[i][j] %= mod;
            v[i][j] = v[i-1][j];

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

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

            v[i][j] += dp[i][j];
            v[i][j] %= mod;
            h[i][j] += dp[i][j];
            h[i][j] %= mod;
            d[i][j] += dp[i][j];
            d[i][j] %= mod;
        }
    }
    cout<<dp[n][m]<<endl;
	return 0;
}
