/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
3 4
...#
.#..
....
---+/
/+---test
5 2
..
#.
..
.#
..
---+/
/+---test
5 5
..#..
.....
#...#
.....
..#..
---+/
/+---test
20 20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
---+/

enum MOD = 1000000007;

void main(string[] args) {
  long H, W;
  readf(" %d %d ", &H, &W);

  auto empty = new bool[][](H);
  foreach (ref row; empty) {
    row = readln.chomp.map!(c => c == '.').array;
  }

  auto dp = new long[][](H, W);
  dp[0][0] = 1;
  foreach (y; 0..H) foreach (x; 0..W) {
    if (!empty[y][x]) continue;

    if (y) dp[y][x] = (dp[y][x] + dp[y-1][x])%MOD;
    if (x) dp[y][x] = (dp[y][x] + dp[y][x-1])%MOD;
  }
  dp[$-1][$-1].writeln;
}
