import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

immutable long MOD = 10^^9 + 7;

void main() {
    auto s = readln.split.map!(to!int);
    auto H = s[0];
    auto W = s[1];
    auto A = H.iota.map!(_ => readln.chomp).array;

    auto dp = new long[][](H, W);
    dp[0][0] = 1;

    foreach (i; 0..H) {
        foreach (j; 0..W) {
            if (A[i][j] == '#') continue;
            foreach (k; 0..2) {
                int ni = i + k;
                int nj = j + 1 - k;
                if (ni >= H || nj >= W || A[ni][nj] == '#') continue;
                (dp[ni][nj] += dp[i][j]) %= MOD;
            }
        }
    }

    dp[H-1][W-1].writeln;
}
