(* O(n!) *)
let n, m = Scanf.scanf " %d %d" @@ fun n m -> n, m
let g = Array.make n []
let visited = Array.make n false
let ans = ref 0
let c = ref 0
let rec dfs v =
    visited.(v) <- true;
    incr c;
    if !c = n then incr ans;
    let f v2 = if not visited.(v2) then (dfs v2; visited.(v2) <- false; decr c) in
    List.iter f g.(v)
let _ =
  for _ = 1 to m do
    Scanf.scanf " %d %d" @@ fun u v ->
      let u, v = u - 1, v - 1 in
      g.(u) <- v :: g.(u);
      g.(v) <- u :: g.(v);
  done;
  dfs 0;
  Printf.printf "%d\n" !ans