{-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Data.List
import Text.Printf
import Debug.Trace

istour g [_] = 1
istour g (x:y:ys) = if [x,y] `elem` g
                    then istour g (y:ys)
                    else 0

main = do
  [n,m] <- getInts
  es <- replicateM m $ getInts
  let g = es ++ map (\(x:y:_) -> [y,x]) es
  print $ sum $ map (istour g) $ map (1:) $ permutations [2..n]


-- util
getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

substr :: Int -> Int -> B.ByteString -> B.ByteString
substr b l s = B.take l $ B.drop b s
