import std.array;
import std.conv;
import std.string;
import std.algorithm;
import std.stdio;

void main() {
	enum Mod = 10 ^^ 9 + 7;

	auto a = readln.chomp.split(' ').map!(to!int).array;
	auto height = a[0];
	auto width = a[1];

	auto grid = new string[height];
	foreach (ref e;grid) {
		e = readln.chomp;
	}

	auto dp = new long[][height + 1];
	foreach (ref e;dp) {
		e = new long[width + 1];
	}
	dp[0][1] = 1;

	foreach (size_t j, line;grid) {
		foreach (size_t i, e;line) {
			if (e == '#') {
				dp[j + 1][i + 1] = 0;
			} else {
				dp[j + 1][i + 1] = (dp[j][i + 1] + dp[j + 1][i]) % Mod;
			}
		}
	}

	writeln(dp[height][width]);
}
