module S = Set.Make(struct type t=int let compare=compare end)
let n,m=Scanf.scanf " %d %d" (fun n m->n,m)
let graph=Array.make (n+1) []
let _ = Array.init m @@ fun _ -> Scanf.scanf " %d %d" @@ fun a b->
  graph.(a) <- b::graph.(a);
  graph.(b) <- a::graph.(b)
let rec dfs i d visited =
  if d=n then 1 else
  graph.(i) |> List.fold_left (fun n j->
    if S.mem j visited then n else
    n+dfs j (d+1) (S.add j visited)
  ) 0
let _ =
  dfs 1 1 (S.singleton 1) |> Printf.printf "%d\n"
