import Control.Applicative ((<$>)) import Data.Bits import Data.List (sort) main :: IO () main = do [n, k] <- map read . words <$> getLine :: IO [Integer] as <- if (k /= 0) then map read . words <$> getLine :: IO [Integer] else return [0, 2^n-1] let as' = sort as print $ (`mod`(10^9+7)) $ product $ zipWith f as' (tail as') f :: Integer -> Integer -> Integer f x y | x.&.y == x = fact $ fromIntegral $ popCount $ y-x | otherwise = 0 where fact 0 = 1 fact n | n > 0 = n * fact (n-1)