import           Control.Monad
import           Data.List

main :: IO ()
main = do
    [n, m] <- readInts
    abs    <- replicateM m readInts
    print $ solve n abs

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

solve :: Int -> [[Int]] -> Int
solve n abs = length $ filter (isPath abs) $ map (1 :) $ permutations [2 .. n]

isPath :: [[Int]] -> [Int] -> Bool
isPath abs [_] = True
isPath abs (x : y : zs) | [a, b] `elem` abs = isPath abs (y : zs)
                        | otherwise         = False
    where [a, b] = sort [x, y]