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

typedef long long LL;
const LL mod = 1e9 + 7;

char g[1010][1010] = {};
LL dp[1010][1010] = {};

int main() {
	int H, W;
	cin >> H >> W;
	for(int i=1;i<=H;i++) {
		cin >> g[i]+1;
	}
	dp[1][1] = 1;
	for(int i=1;i<=H;i++) {
		for(int j=1;j<=W;j++) {
			if(j==1&&i==1) continue;
			if(g[i][j] != '#') {
				dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % mod;
			}
		}
	}
	cout << dp[H][W];
}