import Data.Array
import Data.Array.IO
import Control.Monad

type Grid = IOUArray (Int, Int) Char
type DP = IOUArray (Int, Int) Int


main = do
  [h,w] <- map read . words <$> getLine :: IO [Int]
  xss <- replicateM h getLine
  grid <- thaw $ listArray ((1,1),(h,w)) $ concat xss :: IO Grid
  dp <- newArray ((1,1),(h,w)) 0 :: IO DP
  writeArray dp (1,1) 1 
  let m = 10^9 + 7
  forM_ [1..h] $ \i -> 
    forM_ [1..w] $ \j -> do
      d <- readArray dp (i,j)
      g <- readArray grid (i,j)
      forM_ [(i+1,j),(i,j+1)] $ \n@(i',j') -> do
        unless (i' > h || j' > w) $ do
          d' <- readArray dp n
          g' <- readArray grid n
          unless (g' == '#') $ do
            writeArray dp n $ ((d+d') `mod` m)
  
  readArray dp (h,w) >>= print
