n,m=list(map(int,input().split()))

G=[[0]*n for i in range(n)]

for i in range(m):

  a,b=list(map(int,input().split()))

  G[a-1][b-1]=G[b-1][a-1]=1



from itertools import permutations

ans=0

p=list(permutations([x for x in range(1,n)]))

for pp in p:

  ok=True

  t=[0]+list(pp)

  for i in range(1,n):

    if G[t[i-1]][t[i]]==0:

      ok=False

  if ok:ans+=1

print(ans)

def dfs(v,visited):

  if all(visited):

    return 1

  res=0

  for nv in G[v]:

    if visited[nv]:

      continue

    visited[nv]=1

    res+=dfs(nv,visited)

    visited[nv]=0

  return res

 

n,m=list(map(int, input().split()))

G=[[] for _ in range(n)]

visited=[0]*n

res=0

 

for i in range(m):

  a,b=list(map(int, input().split()))

  G[a-1].append(b-1)

  G[b-1].append(a-1)



visited[0]=1

print((dfs(0,visited)))
n, m = list(map(int, input().split()))
G = [[0] * n for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    G[a - 1][b - 1] = G[b - 1][a - 1] = 1
from itertools import permutations

ans = 0
p = list(permutations([x for x in range(1, n)]))
for pp in p:
    ok = True
    t = [0] + list(pp)
    for i in range(1, n):
        if G[t[i - 1]][t[i]] == 0:
            ok = False
    if ok:
        ans += 1
print(ans)

def dfs(v, visited):
    if all(visited):
        return 1
    res = 0
    for nv in G[v]:
        if visited[nv]:
            continue
        visited[nv] = 1
        res += dfs(nv, visited)
        visited[nv] = 0
    return res


n, m = list(map(int, input().split()))
G = [[] for _ in range(n)]
visited = [0] * n
res = 0
for i in range(m):
    a, b = list(map(int, input().split()))
    G[a - 1].append(b - 1)
    G[b - 1].append(a - 1)
visited[0] = 1
print((dfs(0, visited)))

+def dfs(v, visited): +    if all(visited): +        return 1 +    res = 0 +    for nv in G[v]: +        if visited[nv]: +            continue +        visited[nv] = 1 +        res += dfs(nv, visited) +        visited[nv] = 0 +    return res + + -G = [[0] * n for i in range(n)] +G = [[] for _ in range(n)] +visited = [0] * n +res = 0 -    G[a - 1][b - 1] = G[b - 1][a - 1] = 1 -from itertools import permutations - -ans = 0 -p = list(permutations([x for x in range(1, n)])) -for pp in p: -    ok = True -    t = [0] + list(pp) -    for i in range(1, n): -        if G[t[i - 1]][t[i]] == 0: -            ok = False -    if ok: -        ans += 1 -print(ans) +    G[a - 1].append(b - 1) +    G[b - 1].append(a - 1) +visited[0] = 1 +print((dfs(0, visited)))