import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.datetime;
import std.numeric;
import std.math;
import std.string;

string my_readln() { return chomp(readln()); }

void main()
{
	auto tokens = my_readln().split();
	auto H = tokens[0].to!ulong;
	auto W = tokens[1].to!ulong;
	string[] a;
	foreach (i; 0..H)
	{
		a ~= my_readln();
	}

	long[1010][1010] memo;
	foreach (ref e; memo) foreach (ref ee; e) ee = -1;
	ulong mod = pow(10, 9) + 7;

	ulong search(long i, long j)
	{
		if (i == W || j == H) return 0;
		if (a[j][i] == '#') return 0;
		if (i == W - 1 && j == H - 1) return 1;
		if (memo[i][j] != -1) return memo[i][j];

		ulong r;
		r = (r + search(i+1, j)) % mod;
		r = (r + search(i, j+1)) % mod;

		stderr.writeln(i, " ", j, " ", r);
		memo[i][j] = r;
		return r;
	}

	ulong ans = search(0, 0);
	
	writeln(ans);
	stdout.flush();
}