function Dfs(v, n, visited) {
  var all_visited = true;
  
  for (var i = 0; i < n; i++) {
    if (visited[i] == false) {
      all_visited = false;
    }
  }

  if (all_visited) {
    return 1;
  }

  var ret = 0;

  for (var i = 0; i < n; i++) {
    if (!g[v][i]) continue;
    if (visited[i]) continue;

    visited[i] = true;
    ret += Dfs(i, n, visited);
    visited[i] = false;
  }

  return ret;
}

function Main(s) {
  // 頂点数 (木なので辺数は N-1 で確定)
  var s = s.split("\n").map(e => e.split(" ").map(e => e*1));
  n = s[0][0], m = s[0][1];
  var e = s.slice(1, m+1);
  // グラフ入力受取 隣接行列
  g = new Array(n+1);
  for (var i = 0; i < n; i++) g[i] = new Array(n).fill(false);
  for (var i = 0; i < m; i++) {
      g[e[i][0]-1][e[i][1]-1] = true;
      g[e[i][1]-1][e[i][0]-1] = true;
  }
  var visited = new Array(8).fill(false);
  visited[0] = true;

  console.log(Dfs(0, n, visited));
  
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
