module IntSet = Set.Make (struct 
  type t = int
  let compare = compare
end)

let rec dfs succ unvisited v =
  let unvisited' = IntSet.remove v unvisited in
  if IntSet.is_empty unvisited' then 1
  else
    List.map (fun v' ->
      if IntSet.mem v' unvisited' then dfs succ unvisited' v'
      else 0) (succ v)
    |> List.fold_left ( + ) 0

let () = Scanf.scanf "%d %d\n" (fun n m ->
  let succ = Array.make n []
  in
  ignore (Array.init m (fun _ ->
    Scanf.scanf "%d %d\n" (fun a b ->
      succ.(a - 1) <- b - 1 :: succ.(a - 1);
      succ.(b - 1) <- a - 1 :: succ.(b - 1))));
  Printf.printf "%d\n" (dfs
    (fun i -> succ.(i))
    (Array.init n (fun i -> i)
      |> Array.fold_left (fun s i -> IntSet.add i s) IntSet.empty) 0))
