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