import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as U
import Control.Monad
import Data.List

readIntPair :: B.ByteString -> (Int,Int)
readIntPair s = p
    where
    Just p = do
        (n1, s') <- B.readInt s
        (n2, _ ) <- B.readInt (B.tail s')
        return (n1,n2)

main :: IO ()
main = do
    (h, w) <- fmap readIntPair B.getLine
    as <- replicateM h B.getLine
    let modulo = 1000000007 :: Int
    let v0 = U.generate w (\i -> if i == 0 then 1 else 0) :: U.Vector Int
    let vn = foldl' step v0 as 
        step tbl line = U.constructN w gen
            where
            gen v | B.index line i == '#' = 0 
                  | i == 0 = tbl U.! i
                  | otherwise = (tbl U.! i + v U.! (i - 1)) `mod` modulo
                  where i = U.length v
    print (U.last vn)
