import java.io.*

val pw = PrintWriter(System.out)
const val MOD = 1000000007L
const val INF = 2147483647
const val LINF = 9223372036854775807L

fun main(args: Array<String>) {
    solve()
    pw.flush()
}

fun solve() {
    val (n, m) = nextIntList()
    val nodes: Array<Node> = Array(n) { Node(it) }
    repeat(m){
        val (a, b) = nextIntList()
        nodes[a - 1].edges.add(b - 1)
        nodes[b - 1].edges.add(a - 1)
    }

    var ans = 0
    val pm = Permutation(n - 1)
    pm.create()
    while(pm.hasNext()){
        val step = pm.nextPerm()
        var index = 0
        var now = 0
        var flag = true
        while(index < n - 1){
            val next = step[index] + 1
            if(!nodes[now].edges.contains(next)){
                flag = false
                break
            }
            index++
            now = next
        }
        if(flag) ans++
    }

    println(ans)

}

fun println(v: String) {
    pw.println(v)
}

fun print(v: String) {
    pw.print(v)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ").toMutableList()
fun nextIntList(index: Int = 0) = next().split(" ").map { it.toInt() + index }.toMutableList()
fun nextLongList(index: Long = 0L) = next().split(" ").map { it.toLong() + index }.toMutableList()
fun nextDoubleList() = next().split(" ").map { it.toDouble() }.toMutableList()

fun ary(n: Int, init: String = "") = Array(n) { init }
fun intAry(n: Int, init: Int = 0) = IntArray(n) { init }
fun longAry(n: Int, init: Long = 0L) = LongArray(n) { init }
fun doubleAry(n: Int, init: Double = 0.0) = DoubleArray(n) { init }
fun ary2(n: Int, m: Int, init: String = "") = Array(n) { Array(m) { init } }
fun intAry2(n: Int, m: Int, init: Int = 0) = Array(n) { IntArray(m) { init } }
fun longAry2(n: Int, m: Int, init: Long = 0) = Array(n) { LongArray(m) { init } }
fun doubleAry2(n: Int, m: Int, init: Double = 0.0) = Array(n) { DoubleArray(m) { init } }
fun ary3(n: Int, m: Int, k: Int, init: String = "") = Array(n) { Array(m) { Array(k) { init } } }
fun intAry3(n: Int, m: Int, k: Int, init: Int = 0) = Array(n) { Array(m) { IntArray(k) { init } } }
fun longAry3(n: Int, m: Int, k: Int, init: Long = 0L) = Array(n) { Array(m) { LongArray(k) { init } } }
fun doubleAry3(n: Int, m: Int, k: Int, init: Double = 0.0) = Array(n) { Array(m) { DoubleArray(k) { init } } }

fun abs(n: Int): Int = Math.abs(n)
fun abs(n: Long): Long = Math.abs(n)
fun abs(n: Double): Double = Math.abs(n)
fun max(vararg values: Int) = if (values.isEmpty()) -INF else values.max()!!
fun max(vararg values: Long) = if (values.isEmpty()) -LINF else values.max()!!
fun min(vararg values: Int) = if (values.isEmpty()) INF else values.min()!!
fun min(vararg values: Long) = if (values.isEmpty()) LINF else values.min()!!
fun swap(a: String, b: String) = Pair<String, String>(b, a)
fun swap(a: Int, b: Int) = Pair<Int, Int>(b, a)
fun swap(a: Long, b: Long) = Pair<Long, Long>(b, a)
fun swap(a: Double, b: Double) = Pair<Double, Double>(b, a)

data class Node(val id: Int, var past: Int = -1, var edges: MutableList<Int> = mutableListOf())

class Permutation(val n: Int, var searched: Int = 0, var nextIndex: Int = 0){
    val size = fact(n)
    val permList = Array(size) { IntArray(n){ 0 } }

    fun fact(n: Int) : Int = if(n == 0) 1 else n * fact(n - 1)
    fun init(){
        create(0, IntArray(n) { 0 }, Array<Boolean>(n){ false })
    }
    fun create(num: Int = 0, list: IntArray = IntArray(size){ 0 }, flag: Array<Boolean> = Array(size) { false }){
        if(num == n){
            permList[searched] = list.copyOf()
            searched++
        }
        for (i in 0 until n) {
            if(flag[i]) continue
            list[num] = i
            flag[i] = true
            create(num + 1, list, flag)
            flag[i] = false
        }
    }
    fun hasNext() : Boolean {
        if(nextIndex < size){
            return true
        } else {
            nextIndex = 0
            return false
        }
    }
    fun nextPerm() : IntArray = permList[nextIndex++]
}

Measured memory_bytes: 157964