import Data.List

main :: IO ()
main = do
    [_, _] <- words <$> getLine
    as <- map read . words <$> getLine

    let odds  = length $ filter odd as
        evens = length $ filter even as

        ox  = 2 ^ odds
        ox' = ox `div` 2
        ex  = 2 ^ evens

    print $ ox' * ex
