import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
toTuples (x : y : _) = [(x, y), (y,x)]

main = do
    [n, m] <- getIntList
    edges <- sort . concatMap toTuples <$> replicateM m getIntList
    let nodes = map (map snd) $ groupBy (\a b -> fst a == fst b) edges
    print $ solve nodes n

solve nodes n = dfs 1 1 [1]
    where dfs node depth visited
              | depth == n = 1
              | null nexts = 0
              | otherwise = sum $ map (\w -> dfs w (depth+1) (w : visited)) nexts
            where nexts = filter (`notElem` visited) (nodes !! (node - 1))