import           Control.Monad
import           Data.List
import qualified Data.Map      as M

main :: IO ()
main = do
  [n, m] <- getInts
  ns <- replicateM m $ toTuple <$> getInts
  let d = make $ concat ns
  print $ solve n d


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

toTuple [n, m] = [(n, m), (m, n)]

make xs = M.fromList $
          map (foldr (\(a, b) (c, d) -> (a, b:d)) (1, [])) $
          groupBy (\a b -> fst a == fst b) $ sort xs

solve n d = go 1 []
  where
    go i xs
      | length xs == (n - 1) = 1
      | otherwise = let ns = filter (not . (`elem` xs)) $ d M.! i
                    in sum $ map (\n -> go n (i:xs)) ns

