import Control.Applicative
import Control.Monad
import Data.List
import Data.Array.IArray
import Data.Graph (buildG)

bfs :: Int -> Array Int [Int] -> [[Int]]
bfs n g = queue
  where
    queue = [1] : walk queue
    walk (xs:xss) = bss ++ walk xss
      where
        as = g ! head xs
        bss = zipWith (:) as (repeat xs)

main :: IO ()
main = do
    [n, m] <- fmap read . words <$> getLine
    as <- fmap concat . replicateM m $ do
        [a, b] <- fmap read . words <$> getLine
        return [(a, b), (b, a)]
    let g = buildG (1, n) as
    let ps = filter ((== n) . length) $ takeWhile ((<= n) . length) (bfs n g)
    let ans = length $ filter (\xs -> sort xs == [1..n]) ps
    print ans