local mod = 1000000007
local function badd(x, y)
  return (x + y) % mod
end

local h, w = io.read("*n", "*n", "*l")
local t = {}
local cnt = {}
for i = 1, h do
  local str = io.read()
  for j = 1, w do
    local idx = (i - 1) * w + j
    t[idx] = str:sub(j, j) == "."
    cnt[idx] = 0
  end
end
cnt[1] = 1
for i = 1, h do
  for j = 1, w do
    local idx = (i - 1) * w + j
    if t[idx] then
      if j < w then
        cnt[idx + 1] = badd(cnt[idx + 1], cnt[idx])
      end
      if i < h then
        cnt[idx + w] = badd(cnt[idx + w], cnt[idx])
      end
    end
  end
end
print(cnt[h * w])
