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

// int/long:		-2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

//#define	INF (1<<30)
#define	INF (2147483647)
// 2^31 -1
//= 1,073,741,824 *2 -1
//=   536,870,912 *4 -1

#define	MOD 1000000007

#define	Rep0(i, n)	for (auto i=0; i<n; i++)
#define	Rep1(i, n)	for (auto i=1; i<=n; i++)
#define Sort(P)	sort(P.begin(), P.end())
#define Rev(P)	reverse(P.begin(), P.end())

#define MPl(x, y)	((((x)+(y))%MOD+MOD)%MOD)
#define MMi(x, y)	((((x)-(y))%MOD+MOD)%MOD)
#define MMul(x, y)	((((x)*(y))%MOD+MOD)%MOD)

int	main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	ll H, W;
	cin >>H >>W;
	vector<vector<int>> S(H+2, vector<int> (W+2, 1));
	Rep1(i, H) {
		string s;
		cin >>s;
		Rep1(j, W) {
			if ('.'==s.at(j-1))
				S.at(i).at(j)=0;
		}
	}
	vector<vector<ll>> DP(H+2, vector<ll> (W+2, 0));
	DP.at(1).at(1)=1;
	vector<vector<ll>> X(H+2, vector<ll> (W+2, 0));
	vector<vector<ll>> Y(H+2, vector<ll> (W+2, 0));
	vector<vector<ll>> Z(H+2, vector<ll> (W+2, 0));
	Rep1(i, H)
		Rep1(j, W) {
			if ((1==i)&&(1==j))
				continue;
			if (1==S.at(i).at(j))
				continue;
			ll D=DP.at(i).at(j);
			// Right
			X.at(i).at(j)=MPl(X.at(i).at(j-1), DP.at(i).at(j-1));
			// Down
			Y.at(i).at(j)=MPl(Y.at(i-1).at(j), DP.at(i-1).at(j));
			// RightDown
			Z.at(i).at(j)=MPl(Z.at(i-1).at(j-1), DP.at(i-1).at(j-1));
			DP.at(i).at(j)=MPl(X.at(i).at(j), MPl(Y.at(i).at(j), Z.at(i).at(j)));
		}
	cout <<DP.at(H).at(W) <<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define vec vector
#define rep(i,n) for (int i=0; i<(n); i++)
#define print(a) cout << a << endl
#define fix(n) fixed << setprecision(n)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define Yes "Yes"
#define YES "YES"
#define No "No"
#define NO "NO"

const ll mod = 1e9+7;
struct mint {
  ll x;
  mint(ll x=0) : x((x%mod+mod)%mod) {}
  mint &operator+=(const mint &p) { if((x += p.x) >= mod) x -= mod; return *this; }
  mint &operator-=(const mint &p) { if((x += mod - p.x) >= mod) x -= mod; return *this; }
  mint &operator*=(const mint &p) { x = x * p.x % mod; return *this; }
  mint &operator/=(const mint &p) { *this *= p.inverse(); return *this; }
  mint operator-() const { return mint(-x); }
  mint operator+(const mint &p) const { return mint(*this) += p; }
  friend mint operator+(const int &c,const mint &p) { return mint(c) += p; }
  mint operator-(const mint &p) const { return mint(*this) -= p; }
  friend mint operator-(const int &c,const mint &p) { return mint(c) -= p; }
  mint operator*(const mint &p) const { return mint(*this) *= p; }
  friend mint operator*(const int &c,const mint &p) { return mint(c) *= p; }
  mint operator/(const mint &p) const { return mint(*this) /= p; }
  friend mint operator/(const int &c,const mint &p) { return mint(c) /= p; }
  bool operator==(const mint &p) const { return x == p.x; }
  friend bool operator==(const int &c,const mint &p) { return mint(c) == p; }
  bool operator!=(const mint &p) const { return x != p.x; }
  friend bool operator!=(const int &c, const mint &p) { return mint(c) != p; }
  mint inverse() const {
    ll a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return mint(u);
  }
  mint pow(ll n) const {
    mint ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  friend ostream &operator<<(ostream &os,const mint &p) { return os << p.x; }
  friend istream &operator>>(istream &is,mint &a) {
    ll t;
    is >> t;
    a = mint(t);
    return (is);
  }
};

int main() {
  int H,W;
  cin >> H >> W;
  vec<string> S(H);
  vec<vec<vec<mint>>> dp(H, vec<vec<mint>>(W, vec<mint>(4)));
  dp[H-1][W-1][0]=1;
  rep(i,H) {
    cin >> S[i];
  }
  for (int i=H-1; i>=0; i--) {
    for (int j=W-1; j>=0; j--) {
      if (S[i][j] == '#')
        continue;
      if (i!=H-1 && S[i+1][j]!='#')
        dp[i][j][0] += dp[i+1][j][1];
      if (j!=W-1 && S[i][j+1]!='#')
        dp[i][j][0] += dp[i][j+1][2];
      if (i!=H-1 && j!=W-1 && S[i+1][j+1]!='#')
        dp[i][j][0] += dp[i+1][j+1][3];
      for (int k=1; k<4; k++)
        dp[i][j][k] = dp[i][j][0];
      if (i!=H-1 && S[i+1][j]!='#')
        dp[i][j][1] += dp[i+1][j][1];
      if (j!=W-1 && S[i][j+1]!='#')
        dp[i][j][2] += dp[i][j+1][2];
      if (i!=H-1 && j!=W-1 && S[i+1][j+1]!='#')
        dp[i][j][3] += dp[i+1][j+1][3];
    }
  }
  print(dp[0][0][0]);
  return 0;
}