module Main

open System

let nm =
    Console.ReadLine().Split(' ')
        |> Array.map int

let mutable xs = Array2D.zeroCreate nm.[0] nm.[0]

for _ in 1..nm.[1] do
    let ab =
        Console.ReadLine().Split(' ')
            |> Array.map int

    let a = ab.[0] - 1
    let b = ab.[1] - 1

    xs.[a, b] <- true
    xs.[b, a] <- true


let mutable ts = [| for _ in 1..nm.[0] -> false |]

let rec solve idx =
    ts.[idx] <- true

    if Array.forall (fun x -> x) ts then
        1
    else
        let mutable res = 0

        for i in 0..(nm.[0] - 1) do
            let x = xs.[idx, i]
            if x && not ts.[i] then
                res <- res + solve i
                ts.[i] <- false

        res

Console.WriteLine(solve 0)
