object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val e = Array.fill(n, n)(false)
  for (_ <- 0 until m) {
    val a, b = sc.nextInt()-1
    e(a)(b) = true
    e(b)(a) = true
  }
  val ans = (1 until n).permutations.count(p => (0 +: p).sliding(2).forall{
    case IndexedSeq(a, b) => e(a)(b)
  })
  println(ans)
}
