{-# LANGUAGE BangPatterns #-}

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

tmain=do
    let h = 1000
    let w = 1000
    let bx = replicate 1000 $ UV.replicate 1000 '.'
    print $ f w bx

main=do
    [h,w] <- map read.words<$>getLine
    bx <- map (UV.fromListN w.B.unpack).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.tail $ UV.scanl' m 0 $ UV.zip v0 bl
        where
            m b (u, f)
                | f == '#' = 0
                | (b+u) < (10^9+7) = b+u
                | otherwise = b+u-(10^9+7)