import Control.Monad
import Data.Maybe
import Data.List
import qualified Data.Vector as V

import qualified Data.ByteString.Char8 as BS

tuplify2 :: [b] -> (b, b)
tuplify2 (x:y:_) = (x,y)
tuplify2 _ = undefined
readInt :: BS.ByteString -> Integer
readInt = fst . fromJust . BS.readInteger
readIntTuple :: BS.ByteString -> (Integer, Integer)
readIntTuple = tuplify2 . map readInt . BS.words

getIntTuple :: IO (Integer, Integer)
getIntTuple = readIntTuple <$> BS.getLine
getIntNTuples :: Integral a => a -> IO [(Integer, Integer)]
getIntNTuples n = map readIntTuple <$> replicateM (fromIntegral n) BS.getLine

main = do
    (n, m) <- getIntTuple
    edge <- getIntNTuples m
    let edges = edge ++ map swap edge
    let perm = length . filter ((all (flip elem edges)) . makeTuples) . map (1:) . permutations $ [2..n]
    print perm


makeTuples :: [Integer] -> [(Integer, Integer)]
makeTuples (x:y:[]) = [(x, y)]
makeTuples (x:y:ys) = (x, y) : makeTuples (y:ys)

swap :: (a, a) -> (a, a)
swap (x, y) = (y, x)