import java.util.Scanner

object Main {
  def solve(N: Int, e: Array[Array[Boolean]]): Int = {
    permutation((2 to N).toArray, 0){ (p, acc) =>
      val path = 1 +: p
      val legit = path zip path.drop(1) forall { case (i, j) =>
        e(i)(j)
      }
      acc + (if(legit) 1 else 0)
    }
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N = sc.nextInt()
    val M = sc.nextInt()
    val e = Array.ofDim[Boolean](N + 1, N + 1)
    (0 until M) foreach { _ =>
      val a = sc.nextInt()
      val b = sc.nextInt()
      e(a)(b) = true
      e(b)(a) = true
    }
    println(solve(N, e))
  }

  @specialized
  def permutation[A, B](a: Array[A], z: B)(f: (Array[A], B) => B): B = {
    def swap(i: Int, j: Int): Unit = {
      val temp = a(i)
      a(i) = a(j)
      a(j) = temp
    }

    def step(n: Int, acc: B): B = n match {
      case 1 => f(a, acc)
      case _ =>
        val acc2 = (0 until n - 1).foldLeft(acc) { (acc0, i) =>
          val acc1 = step(n - 1, acc0)
          if (n % 2 == 0) {
            swap(i, n - 1)
          } else {
            swap(0, n - 1)
          }
          acc1
        }
        step(n - 1, acc2)
    }

    step(a.length, z)
  }
}
