function main(lines) {
  const [N, M] = na();
  
  // 頂点情報構築
  const nodes = Array(N+1).fill(0).map(() => new Set());
  for (let i = 1; i <= M; i++) {
    const [a, b] = na();
    nodes[a].add(b);
    nodes[b].add(a);
  }

  // ルート探索
  const ans = countRoute(nodes[1], [1]);

  // 探索再帰関数
  function countRoute(node, passed) {
    return passed.length == N ? 1
      : Array.from(node).reduce((cnt, n) => {
        return passed.includes(n) ? cnt
          : cnt + countRoute(nodes[n], passed.concat(n));
      }, 0);
  }
  
  return ans;
}


const lines = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");

let lineCount = 0;
const s = () => lines[lineCount++];
const n = () => Number(s());
const b = () => BigInt(s());
const sa = () => s().split(' ');
const na = () => sa().map(Number);
const ba = () => sa().map(BigInt);

const ans = main(lines);
console.log( ans );