import std.stdio, std.string, std.algorithm, std.range, std.conv;

void main() {
  long H, W;
  readf(" %d %d ", &H, &W);
  
  bool[][] M;
  M.length = H; 
  foreach (ref r; M) {
    r = readln.map!(x => x != '#').array;
  }
  
  long[][] dp;
  dp.length = H;
  foreach (ref x; dp) x.length = W;
  
  foreach (x; 0..W) {
    if (!M[0][x]) break;
    dp[0][x] = 1;
  }
  foreach (y; 0..H) {
    if (!M[y][0]) break;
    dp[y][0] = 1;
  }
  
  foreach (y; 1..H) foreach (x; 1..W) {
    if (M[y][x]) {
      dp[y][x] = (dp[y-1][x] + dp[y][x-1])%1000000007;
    }
  }
  dp[$-1][$-1].writeln;
}