import util.control.Breaks._

object Main extends App {
  val Array(n, m) = io.StdIn.readLine().split(' ').map(_.toInt)
  val edges = Array.fill(n+1)(Array.fill(n+1)(false))
  var count = 0
  for (_ <- 0 until m; Array(a, b) = io.StdIn.readLine().split(' ').map(_.toInt))
    edges(a)(b) = true
  for (p <- (2 to n).permutations) {
    var current = 1
    breakable {
      for (next <- p) {
        if (!edges(current)(next) && !edges(next)(current)) break
        current = next
      }
      count += 1
    }
  }
  println(count)
}