import Data.List

solve :: Int -> Int -> Int -> Int
solve h w k = (acc !! h) !! 0 where

  acc = iterate f iAcc where
    iAcc = map (iteF 1 0 . (== k)) [1..w]
    f acc = foldl1' (zipWith mAdd) (map (change acc) validH)

  validH = filter isValid (power !! (w - 1))

isValid q = not $ or $ zipWith (&&) q (tail q)

power = iterate (concatMap (\q -> [False:q, True:q])) [[]]

change [x]       []         = [x]
change (x:xs)    (False:bs) = x  : change xs     bs
change (x:x':xs) (True:bs)  = x' : change (x:xs) bs

mPrime = 10^9 + 7

mAdd :: Int -> Int -> Int
mAdd x y = (x + y) `mod` mPrime

iteF t e c = if c then t else e

tmain :: String -> Int
tmain cont =
  let [h,w,k] = map read (words cont)
  in solve h w k

main :: IO ()
main = putStrLn . show . tmain =<< getContents
