import Control.Monad
import Data.List

main :: IO ()
main = do
  [n, m] <- map (read :: String -> Int) . words <$> getLine
  strs <- replicateM m getLine
  let es = sort $ concatMap strToEdge strs
  let nodes = createNodeList es
  print $ solve nodes n

type Edge = (Int, Int)
type Path = [Int]

strToEdge :: String -> [Edge]
strToEdge str = [(from, to), (to, from)]
  where
    [from, to] = map read $ words str

createNodeList :: [Edge] -> [[Int]]
createNodeList es = map (map snd) $ groupBy (\a b -> fst a ==  fst b)  $ sort es

solve :: [[Int]] -> Int  -> Int
solve nodes n = dfs 1 1 [1]
  where
    dfs :: Int -> Int -> [Int] -> Int
    dfs i depth visited
      | depth == n = 1
      | null candidate = 0
      | otherwise = sum $ map (\w -> dfs w (depth+1) (w:visited)) candidate
          where candidate = filter (`notElem` visited)(nodes !! (i - 1))
