import itertools

N,M=list(map(int,input().split()))

edges={tuple(sorted(map(int,input().split()))) for i in range(M)}

ans=0

for i in itertools.permutations(list(range(2,N+1)),N-1):

    l=[1]+list(i)

    ans+=sum(1 for edge in zip(l,l[1:]) if tuple(sorted(edge)) in edges)==N-1

print(ans)
import itertools

N,M=list(map(int,input().split()))

edges=set()

for _ in range(M):

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

  edges.add((a,b))

  edges.add((b,a))

  

  

answer=0





for p in itertools.permutations(list(range(1,N+1))):

  if p[0] !=1:

    continue

  bl=True

  for i in range(N-1):

    if(p[i],p[i+1]) not in edges:

      bl =False

      break

  if bl:

    answer +=1

    

    

print(answer)
import itertools

N, M = list(map(int, input().split()))
edges = {tuple(sorted(map(int, input().split()))) for i in range(M)}
ans = 0
for i in itertools.permutations(list(range(2, N + 1)), N - 1):
    l = [1] + list(i)
    ans += sum(1 for edge in zip(l, l[1:]) if tuple(sorted(edge)) in edges) == N - 1
print(ans)

import itertools

N, M = list(map(int, input().split()))
edges = set()
for _ in range(M):
    a, b = list(map(int, input().split()))
    edges.add((a, b))
    edges.add((b, a))
answer = 0
for p in itertools.permutations(list(range(1, N + 1))):
    if p[0] != 1:
        continue
    bl = True
    for i in range(N - 1):
        if (p[i], p[i + 1]) not in edges:
            bl = False
            break
    if bl:
        answer += 1
print(answer)

-edges = {tuple(sorted(map(int, input().split()))) for i in range(M)} -ans = 0 -for i in itertools.permutations(list(range(2, N + 1)), N - 1): -    l = [1] + list(i) -    ans += sum(1 for edge in zip(l, l[1:]) if tuple(sorted(edge)) in edges) == N - 1 -print(ans) +edges = set() +for _ in range(M): +    a, b = list(map(int, input().split())) +    edges.add((a, b)) +    edges.add((b, a)) +answer = 0 +for p in itertools.permutations(list(range(1, N + 1))): +    if p[0] != 1: +        continue +    bl = True +    for i in range(N - 1): +        if (p[i], p[i + 1]) not in edges: +            bl = False +            break +    if bl: +        answer += 1 +print(answer)