fun main(args: Array<String>) = yorukatsu11e()

fun yorukatsu11e() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val edges = Array(m) {
        readLine()!!.split(' ').map { it.toInt() - 1 }.let { Edge(it[0], it[1]) }
    }

    val graph = Array(n) { Vertex(it) }
    edges.forEach {
        val (from, to) = it
        graph[from].neighbor.add(to)
        graph[to].neighbor.add(from)
    }

    val permutations = permutations((0 until n).toList())
        .filter { it[0] == 0 }

    val answer = permutations.count { paths ->
        (0 until n - 1).all { graph[paths[it]].neighbor.contains(paths[it + 1]) }
    }

    println(answer)
}

private data class Edge(val from: Int, val to: Int)
private data class Vertex(val index: Int, val neighbor: MutableSet<Int> = mutableSetOf())

private fun permutations(src: List<Int>): List<List<Int>> {
    if (src.size == 1) return listOf(src)
    val perms = mutableListOf<List<Int>>()
    val insertElement = src[0]
    permutations(src.drop(1)).forEach { perm ->
        for (i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, insertElement)
            perms.add(newPerm.toList())
        }
    }
    return perms
}
