'use strict'

function main(s) {

  s = s.split('\n');

  const N = Number(s[0].split(' ')[0]);
  const link = s.slice(1, -1).map(l => l.split(' ').map(n => Number(n)));

  const mx = [...Array(N)].map(l => [...Array(N)].fill(0));

  for (const l of link) {
    const fr = l[0] - 1;
    const to = l[1] - 1;
    mx[fr][to] = 1;
    mx[to][fr] = 1;
  }

  let sum = 0;
  const dfs = (v, visited) => {
    if (visited.every(v => v === true)) sum += 1;

    for (let i = 0; i < N; i++) {
      if (mx[v][i] === 0) continue;
      if (visited[i]) continue;

      visited[i] = true;
      dfs(i, visited);
      visited[i] = false;
    }
    return;
  }

  const visited = [true, ...[...Array(N - 1)].map(l => false)];
  dfs(0, visited);

  console.log(sum);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
