#include <iostream>
#include <vector>
using namespace std;
const int MOD=1000000007;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int h,w;
	char c;
	cin >> h >> w;
	vector<vector<int>> v(h+1,vector<int>(w+1));
	v[1][1]++;
	for (int i=1; i<=h; ++i){
		for (int j=1; j<=w; ++j){
			cin >> c;
			if (c == '.') v[i][j] += (v[i][j-1]+v[i-1][j])%MOD;
			v[i][j] %= MOD;
		}
	}
	cout << v[h][w]%MOD;
	return 0;
}