import Data.List
import Data.Tuple

main = do
  (n:m:_) <- getLine >>= return . map read . words :: IO [Int]
  paths <- getContents >>= return . (\x -> x ++ (map swap x)) . map ((\(a:b:_) -> (a,b)) . map read . words) . lines :: IO [(Int, Int)]

  print $ length $ filter id $ map (solve paths) (map (1:) $ permutations [2..n])

  where
    solve paths stroke = solve' stroke paths
    solve' (_:[]) _ = True
    solve' (a:b:rest) paths = if elem (a,b) paths then solve' (b:rest) paths else False
