import Data.List
import Data.Tuple
import qualified Data.ByteString.Char8 as BS
main = do
  [n,m] <- map read . words <$> getLine :: IO [Int]
  xs <- map (\[a,b] -> (a,b)) . map (map (read . BS.unpack) . BS.words) . BS.lines <$> BS.getContents :: IO [(Int,Int)]
  print $ step n (xs ++ map swap xs) 1 []

step :: Int -> [(Int,Int)] -> Int -> [Int] -> Int
step n path dest arrived =
  let 
    ns = map snd $ filter (\(a,_) -> a==dest) path
  in
    if sort (dest:arrived) == [1..n] 
       then 1
    else if dest `elem` arrived 
       then 0
    else
       sum $ [r | next<-ns, let r = step n path next (dest:arrived)]
