import itertools



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

route=[list(map(int,input().split())) for _ in range(M)]

candidate=list(itertools.permutations(list(range(1,N+1))))



ans=0

for c in candidate:

  if c[0]==1:

    for i in range(N-1):

      l=sorted([c[i], c[i+1]])

      if l not in route:

         break

    else:

      ans+=1

print(ans)



import itertools

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



G = {k: set() for k in range(N+1)}

for _ in range(M):

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

    # 無向グラフ

    G[a].add(b)

    G[b].add(a)



ans = 0

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

    c = 1

    for n in p:

        if n not in G[c]:

            break

        c = n

    else:

        ans += 1



print(ans)

import itertools

N, M = list(map(int, input().split()))
route = [list(map(int, input().split())) for _ in range(M)]
candidate = list(itertools.permutations(list(range(1, N + 1))))
ans = 0
for c in candidate:
    if c[0] == 1:
        for i in range(N - 1):
            l = sorted([c[i], c[i + 1]])
            if l not in route:
                break
        else:
            ans += 1
print(ans)

import itertools

N, M = list(map(int, input().split()))
G = {k: set() for k in range(N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    # 無向グラフ
    G[a].add(b)
    G[b].add(a)
ans = 0
for p in itertools.permutations(list(range(2, N + 1))):
    c = 1
    for n in p:
        if n not in G[c]:
            break
        c = n
    else:
        ans += 1
print(ans)

-route = [list(map(int, input().split())) for _ in range(M)] -candidate = list(itertools.permutations(list(range(1, N + 1)))) +G = {k: set() for k in range(N + 1)} +for _ in range(M): +    a, b = list(map(int, input().split())) +    # 無向グラフ +    G[a].add(b) +    G[b].add(a) -for c in candidate: -    if c[0] == 1: -        for i in range(N - 1): -            l = sorted([c[i], c[i + 1]]) -            if l not in route: -                break -        else: -            ans += 1 +for p in itertools.permutations(list(range(2, N + 1))): +    c = 1 +    for n in p: +        if n not in G[c]: +            break +        c = n +    else: +        ans += 1