{-# LANGUAGE BangPatterns #-}

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

main=do
    [h,w] <- map read.words<$>getLine
    bx <- B.lines <$> B.getContents
    print $ f w bx

f w !bx = UV.last $ foldl' p (UV.cons 1 $ UV.replicate (w-1) (0::Int)) bx where
    p !v0 bl = UV.constructN w m where
        m v1
            | B.index bl l == '#' = 0
            | l == 0 = UV.head v0
            | otherwise = (UV.last v1 + v0 UV.! l) `mod` (10^9+7)
            where l = UV.length v1