local n, m = io.read("*n", "*n")
local t = {}
for i = 1, n do t[i] = {} end
for i = 1, m do
  local a, b = io.read("*n", "*n")
  t[a][b], t[b][a] = true, true
end
local mult = 1
for i = 2, n - 1 do
  mult = mult * i
end
local cnt = 0
for i = 0, mult - 1 do
  local rem = {}
  local resarray = {1}
  for j = 2, n do rem[j - 1] = j end
  local it = i

  local tmpmult = mult
  for j = n - 1, 1, -1 do 
    local divfactor = tmpmult / j
    local pos = 1 + math.floor(it / divfactor)
    table.insert(resarray, rem[pos])
    table.remove(rem, pos)
    tmpmult = divfactor
    it = it % divfactor
  end
  local isok = true
  for j = 1, n - 1 do
    if(not t[resarray[j]][resarray[j+1]]) then
      isok = false
      break
    end
  end
  if(isok) then cnt = cnt + 1 end
end
print(cnt)
