import java.util.*
class SearchInfo(val nodeNumber: Int, val visitedNodes: Set<Int>)
fun main(args : Array<String>) {
    val (N, M) = readLine()!!.split(" ").map { it.toInt() }
    val graph = Array(N, { Array(N, { false }) })

    (1..M).forEach {
        val (a, b) = readLine()!!.split(" ").map { it.toInt() }
        graph[a-1][b-1] = true
        graph[b-1][a-1] = true
    }

    val queue : Queue<SearchInfo>  = ArrayDeque()

    graph[0].forEachIndexed { nodeNum, exists ->
        if (exists) {
            queue.offer(SearchInfo(nodeNum, setOf(0, nodeNum)))
        }
    }

    var count = 0
    while (queue.isNotEmpty()) {
        val searchInfo = queue.poll()
        if (searchInfo.visitedNodes.size == N) {
            count++
        } else {
            val currentNodeNum = searchInfo.nodeNumber
            graph[currentNodeNum].forEachIndexed{ node, exists ->
                if (exists && !searchInfo.visitedNodes.contains(node)) {
                    //println(searchInfo.visitedNodes.plus(node).toString())
                    queue.offer(SearchInfo(node, searchInfo.visitedNodes.plus(node)))
                }
            }
        }
    }

    println(count)
}