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

const int N=2e3+20,MOD=1e9+7;

int n,m,r[N][N],c[N][N],d[N][N],dp[N][N];
char a[N][N];

void add(int &x,int y) {x=(x+y%MOD)%MOD;}

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf(" %s",a[i]+1);

	dp[1][1]=1;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			if(a[i][j]=='#') continue;

			add(dp[i][j],r[i][j]);
			add(dp[i][j],c[i][j]);
			add(dp[i][j],d[i][j]);

			add(r[i][j+1],dp[i][j]+r[i][j]);
			add(c[i+1][j],dp[i][j]+c[i][j]);
			add(d[i+1][j+1],dp[i][j]+d[i][j]);
		}
	}

	printf("%d",dp[n][m]);
}
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
 
// Use g++ compiler for this include to work.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
// Constants 
#define INF 2e18
#define EPS 1e-9
#define MOD 1000000007 
 
// // for using in pairs
#define F first
#define S second
 
// Macros
#define all(x) begin(x), end(x)
#define allr(x) rbegin(x), rend(x)
 
// aliases
using ll = long long;
using ull = unsigned long long;
using ui = unsigned int;
using ld = long double;
 
template<typename T>
using oset = tree<T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
 
// Temporary macro.
#define int long long
 
// Operator overloads.
 
/**
 * Both types in the pair should have overload for << operator with ostream. 
 */
template<typename T1, typename T2>
ostream& operator<<(ostream &ostream, pair<T1, T2>& p)
{
	ostream << p.first << " " << p.second;
	return ostream;
}
 
/**
 * The type of element in the vector should have overload for << operator with ostream. 
 */
template<typename T>
ostream& operator<<(ostream &stream, vector<T>& v)
{
	for (const auto &it : v)
		stream << it << " ";
	return stream;
}
 
template<typename T1, typename T2>
istream& operator>>(istream &istream, pair<T1, T2>& p)
{
	istream >> p.first >> p.second;
	return istream;
}
 
template<typename T>
istream& operator>>(istream &istream, vector<T>& a)
{
	for (auto &it : a)
		istream >> it;
	return istream;
}
 
// Utility functions.
 
template<typename T>
T MIN(T first) { return first; }
 
template<typename T, typename... Args>
T MIN(T first, Args... args) { return min(first, MIN(args...)); }
 
template<typename T>
T MAX(T first) { return first; }
 
template<typename T, typename... Args>
T MAX(T first, Args... args) { return max(first, MAX(args...)); }
 
template <typename T>
void DEBUG(T&& t) {cout << t << "\n";}
 
template <typename T, typename... Args>
void DEBUG(T&& t, Args&&... args) 
{
    cout << t << " ";
    DEBUG(forward<Args>(args)...);
}
 
template<typename T>
int32_t size_i(T& container) { return static_cast<int32_t>(container.size()); }
 
// Mathematical functions.
 
int GCD(int a, int b)
{
	if (!b)
		return a;
	return GCD(b, a % b);
}
 
int LCM(int a, int b)
{
	return (a * b) / GCD(a, b);
}
 
int modpow(int x, int n, int m = INF)
{
	if (n == 0) return 1 % m;
	long long u = modpow(x, n / 2, m);
	u = (u * u) % m;
	if (n % 2 == 1)
		u = (u * x) % m;
	return u;	
}
 
/**
 * m should be prime
 */
int modinv(int x, int m = MOD)
{
	return modpow(x, m - 2, m);
}
 
//////////////////// START CODE HERE ///////////////////////////
 
void preSolve() 
{
}
 
struct comp
{
	int l, t, lt, val;
	comp()
	{
		l = 0;
		t = 0;
		lt = 0;
		val = 0;
	}
	comp(int l, int t, int lt, int val)
		: l(l), t(t), lt(lt), val(val) {}
	int sum() { return l + lt + t; }
};
 
void solve(int tc)
{
	int n, m;
	cin >> n >> m;
	char a[n + 1][m + 1];
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++)
			cin >> a[i][j];
 
	comp dp[n + 1][m + 1];
	for (int i = 0; i <= n; i++)
	{
		for (int j = 0; j <= m; j++)
		{
			if (!i || !j)
				continue;
			if (a[i][j] == '#')
			{
				dp[i][j] = comp();
				continue;
			}
			if (i == 1 && j == 1)
			{
				dp[1][1] = comp(0, 0, 0, 1);
				continue;
			}
			dp[i][j] = comp();
			dp[i][j].l  += (dp[i][j - 1].val + dp[i][j - 1].l) % MOD;
			dp[i][j].t  += (dp[i - 1][j].val + dp[i - 1][j].t) % MOD;
			dp[i][j].lt += (dp[i - 1][j - 1].val + dp[i - 1][j - 1].lt) % MOD;
			dp[i][j].val = (dp[i][j].sum()) % MOD;
		}
	}
 
	cout << dp[n][m].val;
}
 
int32_t main() 
{
	#ifdef LOCAL_PROJECT
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#else
		// freopen("input.txt", "r", stdin);
		// freopen("output.txt", "w", stdout);
	#endif
 
	ios_base::sync_with_stdio(false);
	cin.tie(0);
 
	preSolve();
 
	int t = 1;
	// cin >> t;
	for (int i = 1; i <= t; i++)
	{
		solve(i);
	}
	return 0;
}