import scala.io.StdIn.readLine
object Main extends App {
  val Array(n, m) = readLine.split(" ").map(_.toInt)
  val paths = Array.fill(m)( readLine.split(" ").map(_.toInt) match {
    case Array(a, b) => Path(a, b)
  } )
  case class Path(v1: Int, v2: Int)

  println(solve(Array.range(1, n + 1), paths, 1))

  def solve(nodes: Array[Int], paths: Array[Path], start: Int): Int = {
    if (nodes.size == 1) 1
    else {
      val newNodes = nodes.filter(_ != start)
      val (release, hold) = paths partition {
        case Path(a, b) => (a == start) || (b == start)
      }
      (0 /: (release map {
        case Path(a, b) => solve(newNodes, hold, if (a == start) b else a)
      }))(_ + _)
    }
  }
}
