#include<bits/stdc++.h>

using namespace std;

const int M = 1e9 +7;

int main(){
	int h , w; 
	cin >> h >> w;
	vector<vector<int>> dp(h, vector<int>(w,0));
	dp[0][0] = 1;
	for(int i = 0; i < h; ++i){
		for(int j = 0; j < w; ++j){
			char c; 
			cin >> c;
			if(c=='.'){
				if(j != 0)
					dp[i][j] = (dp[i][j] + dp[i][j-1]) % M;
				if(i != 0)
					dp[i][j] = (dp[i][j] + dp[i-1][j]) % M;
			}
		}
	}
	cout << dp[h-1][w-1];
			
	return 0;
}
