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

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