import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

/*

グリッド
経路数
剰余

x[i][j] = x[i - 1][j] + x[i][j - 1] % mod


*/

const long mod = 1_000_000_007;

void main(){
	int h = read.to!int;
	int w = read.to!int;
	
	char[][] cells;
	foreach(i; 0 .. h) cells ~= readln.chomp.to!(char[]);
	
	long[] xs;
	foreach(i; 0 .. h){
		foreach(j; 0 .. w){
			if(i == 0){
				if(j == 0) xs ~= 1;
				else xs ~= 0;
			}
			if(cells[i][j] == '#'){
				xs[j] = 0;
			}
			else if(j > 0){
				xs[j] += xs[j - 1];
				xs[j] %= mod;
			}
		}
	}
	
	xs[w - 1].writeln;
	
}
