fun main() {
  val (N, M) = readInts()
  val edges = Array(N + 1) { mutableSetOf<Int>() }
  repeat(M) {
    val (a, b) = readInts()
    edges[a].add(b)
    edges[b].add(a)
  }
  fun isOk(list: List<Int>): Boolean {
    if (list.first() != 1) return false
    for (i in 0 until N - 1) {
      val a = list[i]
      val b = list[i + 1]
      if (!edges[a].contains(b)) return false
    }
    return true
  }

  val permList = permute((1..N).map { it })
  var sum = 0L
  for (perm in permList) {
    if (isOk(perm)) sum++
  }
  println(sum)
}

fun <Int> permute(list: List<Int>): List<List<Int>> {
  if (list.size == 1) return listOf(list)
  val perms = mutableListOf<List<Int>>()
  val sub = list[0]
  for (perm in permute(list.drop(1)))
    for (i in 0..perm.size) {
      val newPerm = perm.toMutableList()
      newPerm.add(i, sub)
      perms.add(newPerm)
    }
  return perms
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }
