#include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define whilet int T;cin>>T;while(T--)
#define clr(a,x) memset(a,x,sizeof(a));
#define ll long long
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;

int d4x[] = {0, 0, 1, -1};
int d4y[] = {1, -1, 0, 0};

int d8x[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int d8y[] = {-1, 0, 1, -1, 1, -1, 0, 1};

const int MOD = (int) 1e9+7;

int h, w;
string s[2005];
ll dp[2005][2005];
ll up[2005][2005], rr[2005][2005], dd[2005][2005];

ll f() {
    for(int i = h-1; i >= 0; i--) {
        for(int j = w-1; j >= 0; j--) {
            if(i == h-1 and j == w-1) {
                dp[i][j] = 1;
                up[i][j] = 1;
                rr[i][j] = 1;
                dd[i][j] = 1;
                continue;
            }
            
            if(s[i][j] == '#') {
                dp[i][j] = 0;
                up[i][j] = 0;
                rr[i][j] = 0;
                dd[i][j] = 0;
                continue;
            }
            
            int res = 0;
            if(i+1 < h) res += up[i+1][j];
            res %= MOD;
            
            if(j+1 < w) res += rr[i][j+1];
            res %= MOD;
            
            if(i+1 < h and j+1 < w) res += dd[i+1][j+1];
            res %= MOD;
            
            dp[i][j] = res;
            
            if(i+1 < h) up[i][j] = dp[i][j] + up[i+1][j];
            else up[i][j] = dp[i][j];
            up[i][j] %= MOD;
            if(j+1 < w) rr[i][j] = dp[i][j] + rr[i][j+1];
            else rr[i][j] = dp[i][j];
            rr[i][j] %= MOD;
            if(i+1 < h and j+1 < w) dd[i][j] = dp[i][j] + dd[i+1][j+1];
            else dd[i][j] = dp[i][j];
            dd[i][j] %= MOD;
        }
    }
    return dp[0][0];
}


int main() {
    IO;

    cin >> h >> w;
    for(int i = 0; i < h; i++) {
        cin >> s[i];
    }
    
    clr(dp, -1);
    
    cout << f();
    return 0;
}

#include<iostream>
#include<vector>
using namespace std;
typedef long long li;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }
// Container コンテナ型, map以外
template< template<class ...> class Ctn,class T>
std::ostream& operator<<(std::ostream& os,const Ctn<T>& v){
  auto itr=v.begin();
  while(itr!=v.end()){
    if(itr!=v.begin())cout << " ";
    cout << *(itr++);
  }
  return os;
}

struct modint{
  li num;

  modint(li a=0){
    num=(a%MOD+MOD)%MOD;
  }
  modint operator+(modint a) {return{(num+a.num)%MOD};} 
  modint operator-(modint a) {return{((num-a.num)%MOD+MOD)%MOD};}
  modint operator*(modint a) {return{num*a.num%MOD};}
  modint inv(const modint& a);
  modint operator/(modint a) {return (*this)*inv(a);}
  modint& operator+=(modint a) {
    (num += a.num)%=MOD;
    return *this;
  }
  modint& operator-=(modint a) {
    (num += MOD-a.num)%=MOD;
    return *this;
  }
  modint& operator*=(modint a) {
    (num*=a.num)%=MOD;
    return *this;
  }
};

std::ostream& operator<<(std::ostream& os, const modint& m){
  // ここでストリームに obj を書き込みます。
  li a=m.num;
  a%=MOD;
  a+=MOD;
  a%=MOD;
  cout << a;
  return os;
}

std::istream& operator>>(std::istream& os,modint& m){
  // ここでストリームに obj を書き込みます。
  li a; cin >>a;
  m=a;
  return os;
}


int main(){
  int h,w; cin >>h >>w;
  vector<string> mp(h);
  rep(i,h) cin >>mp[i];

  auto judge=
    [&](int i,int j){
      if(i<0 or j<0) return 0;
      if(mp[i][j]=='#') return 0;
      return 1;
    };
  
  vector<vector<modint>> dp(h,vector<modint>(w,0));
  vector<vector<modint>> tt(h,vector<modint>(w,0));
  vector<vector<modint>> yk(h,vector<modint>(w,0));
  vector<vector<modint>> nn(h,vector<modint>(w,0));
  dp[0][0]=tt[0][0]=yk[0][0]=nn[0][0]=1;
  rep(i,h) rep(j,w){
    if(!judge(i,j))continue;
    int ii=i-1,jj=j-1;
    if(df)print("i,j",i,j);
    if(judge(ii,jj)) dp[i][j]+=nn[ii][jj];
    if(df)if(judge(ii,jj)) print("nn",nn[ii][jj],dp[i][j]);
    if(judge(i,jj)) dp[i][j]+=yk[i][jj];
    if(df)if(judge(i,jj)) print("yk",yk[i][jj],dp[i][j]);
    if(judge(ii,j)) dp[i][j]+=tt[ii][j];
    if(df)if(judge(ii,j)) print("tt",tt[ii][j],dp[i][j]);

    tt[i][j]=yk[i][j]=nn[i][j]=dp[i][j];
    if(judge(ii,jj)) nn[i][j]+=nn[ii][jj];
    if(judge(i,jj)) yk[i][j]+=yk[i][jj];
    if(judge(ii,j)) tt[i][j]+=tt[ii][j];
    if(df){
      if(df)print("dp");
      rep(i,h) print(dp[i]);
      if(df)print("tt");
      rep(i,h) print(tt[i]);
      if(df)print("yk");
      rep(i,h) print(yk[i]);
      if(df)print("nn");
      rep(i,h) print(nn[i]);
    }
  }
  if(df){
    if(df)print("dp");
    rep(i,h) print(dp[i]);
    if(df)print("tt");
    rep(i,h) print(tt[i]);
    if(df)print("yk");
    rep(i,h) print(yk[i]);
    if(df)print("nn");
    rep(i,h) print(nn[i]);
  }
    
  print(dp[h-1][w-1]);
}
