
import java.util.Scanner

/**
 * Created by sonetsuyoshi on 2015/12/16.
 */

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val m = sc.nextInt

  val connected = Array.ofDim[Boolean](n,n)
  val visited = Array.ofDim[Boolean](n)

  val ids = 0.until(n)

  for(i <- 0 until m) {
    val a = sc.nextInt - 1
    val b = sc.nextInt - 1
    connected(a)(b) = true
    connected(b)(a) = true
  }

  run()

  def run(): Unit = {
    visited(0) = true
    val ans = search(0)
    println(ans)
  }

  def search(id: Int): Int = {
    val adjs = ids.filter(i => connected(id)(i) && !visited(i))

    if(adjs.size == 0) {
      if(visited.forall(x => x)) 1
      else 0
    } else {
      adjs.foldLeft(0){(s, i) => {
        visited(i) = true
        val s1 = s + search(i)
        visited(i) = false
        s1
      }}
    }
  }
}
