import Control.Monad
import Data.List
import Data.Maybe

main :: IO ()
main = do
    [n, m] <- getInts
    edges <- fmap sort $ forM [1..m] $ \_ -> do
        [a, b] <- getInts
        pure (a, b)
    putStrLn $ if fst (edges !! 0) /= 1
                  then "0"
                  else show $ solve 1 [2..n] edges


type Node = Int
type Edge = (Node, Node)

solve :: Node -> [Node] -> [Edge] -> Int
solve _ [] _ = 1
solve _ _ [] = 0
solve current unvisited edges =
    sum $ map go nextEdges
    where
        nextEdges = mapMaybe (getConnected current) edges
        go (nextNode, nextEdge) = solve nextNode (filter (/= nextNode) unvisited) (filter (\e -> fst e /= current || snd e /= current) edges)

getConnected :: Node -> Edge -> Maybe (Node, Edge)
getConnected current e@(a, b)
    | current == a = Just (b, e)
    | current == b = Just (a, e)
    | otherwise = Nothing

getInts :: IO [Int]
getInts = map read . words <$> getLine
