import Data.Array
import Data.Bits
import Data.Bool
import qualified Data.ByteString.Char8 as C
import Data.List

main = C.interact $ put . sol . get

get = fmap (unfoldr (C.readInt . C.dropWhile (==' '))) . C.lines

put = C.pack . show

sol :: [[Int]] -> Int
sol ([n,_]:es)= bitDP 1 (2^n-1)
  where
  e = accumArray (||) False ((1,1),(n,n)) $
    (\[a,b] -> ((a,b),True)) <$> es
  outvs vs v = [u | u <- [1..n], testBit vs (u-1), e!(min u v, max u v)]
  bitDP p vs
    | popCount vs==1  = bool 0 1 $ 2^(p-1)==vs
    | otherwise       = sum [bitDP c vs' | c <- outvs vs' p]
    where
    vs' = clearBit vs (p-1)
