#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define vt vector
#define pb push_back
#define mp make_pair
#define rep(i, n) for (int i = 0; i < n; i++)
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
const int64_t MOD = 1000000007;

// 🚩
// 20201204 00:47~
//
int main()
{
    ll H, W;
    cin >> H >> W;
    vt<string> S(H);
    rep(i, H) cin >> S.at(i);
    vt<vt<ll>> dp(H, vt<ll>(W, 0)), dpX(H, vt<ll>(W, 0)), dpY(H, vt<ll>(W, 0)), dpXY(H, vt<ll>(W, 0));
    dp.at(0).at(0) = 1;
    dpX.at(0).at(0) = 1;
    dpY.at(0).at(0) = 1;
    dpXY.at(0).at(0) = 1;
    rep(i, H)
    {
        rep(j, W)
        {
            if (S.at(i).at(j) == '#') continue;
            if (j > 0) dp.at(i).at(j) += dpX.at(i).at(j - 1);
            if (i > 0) dp.at(i).at(j) += dpY.at(i - 1).at(j);
            if (i > 0 && j > 0) dp.at(i).at(j) += dpXY.at(i - 1).at(j - 1);
            dp.at(i).at(j) %= MOD;
            dpX.at(i).at(j) = dp.at(i).at(j);
            dpY.at(i).at(j) = dp.at(i).at(j);
            dpXY.at(i).at(j) = dp.at(i).at(j);
            if (j > 0) dpX.at(i).at(j) += dpX.at(i).at(j - 1);
            if (i > 0) dpY.at(i).at(j) += dpY.at(i - 1).at(j);
            if (i > 0 && j > 0) dpXY.at(i).at(j) += dpXY.at(i - 1).at(j - 1);
            dpX.at(i).at(j) %= MOD;
            dpY.at(i).at(j) %= MOD;
            dpXY.at(i).at(j) %= MOD;
        }
    }
    cout << dp.at(H - 1).at(W - 1) << endl;
}

#include <bits/stdc++.h>
using namespace std;

const int MOD = 1000000007;
const int INF = 1e9;
const long long INFLL = 1e18;
using ll = long long;

int main(){
  int h, w;
  cin >> h >> w;
  const int MAX = 2000;
  char s[MAX][MAX];
  for(int i = 0; i < h; i++) {
    for(int j = 0; j < w; j++){
      cin >> s[i][j];
    }
  }

  vector<vector<ll>> dp(h, vector<ll>(w, 0));
  dp[0][0] = 1;
  vector<ll> sita(w, 0);
  ll migi;
  vector<vector<ll>> naname(h, vector<ll>(w, 0));
  for(int i = 0; i < h; i++){
    migi = 0;
    for(int j = 0; j < w; j++){
      if(s[i][j] == '#'){
        // dp[i][j] = -1;
        migi = 0;
        sita[j] = 0;
        naname[i][j] = 0;
      }else{
        if(i == 0){
          if(j == 0) {
            migi = dp[i][j];
          }else{
            dp[i][j] = migi;
            migi += dp[i][j];
          }
          sita[j] = dp[i][j];
          naname[i][j] = dp[i][j];
        }else{
          if(j == 0){
            dp[i][j] = sita[j];
            sita[j] += dp[i][j];
            naname[i][j] = dp[i][j];
          }else{
            // cout << naname[i-1][j-1] << endl;
            dp[i][j] = migi + sita[j] + naname[i-1][j-1];
            sita[j] += dp[i][j];
            naname[i][j] = naname[i-1][j-1] + dp[i][j];
          }
          migi += dp[i][j];
        }
      }
      if(dp[i][j] != -1) dp[i][j] %= MOD;
      migi %= MOD;
      sita[j] %= MOD;
      naname[i][j] %= MOD;
      // cout << dp[i][j];
    }
    // cout << endl;
  }

  cout << dp[h-1][w-1] << endl;

  return 0;
}