function main(lines) {
  const [N, M] = na();
  
  // 頂点情報構築
  for (let i = 0; i < M; i++) {
    const [a, b] = na();
    nodes[a-1][b-1] = nodes[b-1][a-1] = true;
  }
  // 訪問済みフラグ
  const visited = Array(N).fill(false);

  // ルート探索
  visited[0] = true;
  const ans = countRoute(0, N, visited);
  
  return ans;
}

// 最大頂点数
const maxN = 8;
// 頂点情報
const nodes = Array(maxN).fill(0).map(_ => Array(maxN).fill(false));
// 探索再帰関数
function countRoute(node, N, visited) {
  if (　visited.every(b => b)　) return 1;
  let ret = 0;
  for (let i = 0; i < N; i++) {
    if (!nodes[node][i] || visited[i]) continue;
    visited[i] = true;
    ret += countRoute(i, N, visited);
    visited[i] = false;
  }
  return ret;
}


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 );