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

const int64_t MOD = 1e9 + 7;
const int64_t MOD2 = 998244353;
const int INF = 1e9;

int main() {
  long long h, w;
  cin >> h >> w;
  vector<string> s(h);
  for (int i=0; i<h; i++) {
    cin >> s.at(i);
  }
  vector<vector<long long>> dp(h, vector<long long>(w));
  dp.at(0).at(0) = 1;
  vector<vector<long long>> row(h, vector<long long>(w));
  vector<vector<long long>> col(h, vector<long long>(w));
  vector<vector<long long>> squ(h, vector<long long>(w));
  row.at(0).at(0) = 1;
  col.at(0).at(0) = 1;
  squ.at(0).at(0) = 1;
  for (int i=0; i<h; i++) {
    for (int j=0; j<w; j++) {
      if (s.at(i).at(j) == '#') {
        continue;
      }
      if (i>0&&j>0) {
        dp.at(i).at(j) = row.at(i).at(j-1) + col.at(i-1).at(j) + squ.at(i-1).at(j-1);
        dp.at(i).at(j) %= MOD;
        row.at(i).at(j) = dp.at(i).at(j) + row.at(i).at(j-1);
        col.at(i).at(j) = dp.at(i).at(j) + col.at(i-1).at(j);
        squ.at(i).at(j) = dp.at(i).at(j) + squ.at(i-1).at(j-1);
      } else if (j>0) {
        dp.at(i).at(j) = row.at(i).at(j-1);
        dp.at(i).at(j) %= MOD;
        row.at(i).at(j) = dp.at(i).at(j) + row.at(i).at(j-1);
        col.at(i).at(j) = dp.at(i).at(j);
        squ.at(i).at(j) = dp.at(i).at(j);
      } else if (i>0) {
        dp.at(i).at(j) = col.at(i-1).at(j);
        dp.at(i).at(j) %= MOD;
        col.at(i).at(j) = dp.at(i).at(j) + col.at(i-1).at(j);
        row.at(i).at(j) = dp.at(i).at(j);
        squ.at(i).at(j) = dp.at(i).at(j);
      }
      col.at(i).at(j) %= MOD;
      row.at(i).at(j) %= MOD;
      squ.at(i).at(j) %= MOD;
    }
  }
  cout << dp.at(h-1).at(w-1)%MOD << endl;
}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define all(x) (x).begin(),(x).end()
#define inf 1e18
#define mod 1000000007

using namespace std;

typedef long long llint;
typedef pair<llint, llint> P;

llint h, w;
llint dp[2005][2005];
llint hsum[2005][2005], wsum[2005][2005], dsum[2005][2005];
char c[2005][2005];

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> h >> w;
	rep(y, 1, h) rep(x, 1, w) cin >> c[x][y];
	
	dp[1][1] = hsum[1][1] = wsum[1][1] = dsum[1][1] = 1;
	rep(x, 1, w){
		rep(y, 1, h){
			if(x == 1 && y == 1) continue;
			if(c[x][y] == '#'){
				dp[x][y] = 0, hsum[x][y] = wsum[x][y] = dsum[x][y] = 0;
				continue;
			}
			dp[x][y] = hsum[x][y-1] + wsum[x-1][y] + dsum[x-1][y-1], dp[x][y] %= mod;;
			hsum[x][y] = hsum[x][y-1] + dp[x][y], hsum[x][y] %= mod;
			wsum[x][y] = wsum[x-1][y] + dp[x][y], wsum[x][y] %= mod;
			dsum[x][y] = dsum[x-1][y-1] + dp[x][y], dsum[x][y] %= mod;
		}
	}
	cout << dp[w][h] << endl;
	
	return 0;
}