main = do
 [n,m]<-map read . words <$> getLine
 asbs <- replicateM m $ map read .words <$> getLine
 let edges = asbs ++ (map reverse asbs)
 print $ length $ f [1] edges (n - 1)
 
next v es = [b| [a,b]<-es , a == v]
g p es = [v:p|v<- next (p!!0) es, not $ v `elem` p]
f ps es 0 = ps 
f ps es n = f (map (flip g es) ps) es n-1