(* 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 i v =
    if i >= n then incr ans
    else
      (visited.(v) <- true;
      for j = 0 to n - 1 do
        if not visited.(j) then
          let f v2 = if v2 = j then dfs (i + 1) v2 in
          List.iter f g.(v);
          visited.(j) <- false
      done)
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 1 0;
  Printf.printf "%d\n" !ans