local function getpattern(n, patall, idx)
  local used = {}
  local retary = {}
  local div = patall
  for i = 1, n do used[i] = false end
  for i = n, 1, -1 do
    div = div // i
    local v_idx = idx // div
    idx = idx % div
    local tmp_idx = 0
    for j = 1, n do
      if not used[j] then
        if tmp_idx == v_idx then
          table.insert(retary, j)
          used[j] = true
          break
        else
          tmp_idx = tmp_idx + 1
        end
      end
    end
  end
  return retary
end

local n, m = io.read("*n", "*n")
local edge = {}
for i = 1, n do
  edge[i] = {}
end
for i = 1, m do
  local a, b = io.read("*n", "*n")
  edge[a][b], edge[b][a] = true, true
end

local tot = 1
local ret = 0
for i = 1, n do tot = tot * i end
for i = 0, tot - 1 do
  local z = getpattern(n, tot, i)
  local v = true
  for j = 1, n - 1 do
    if not edge[z[j]][z[j + 1]] then
      v = false
      break
    end
  end
  if z[1] == 1 and v then ret = ret + 1 end
end
print(ret)
