import itertools

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

E = set([tuple(sorted(map(int, input().split()))) for x in range(M)])

cnt = 0

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

    l = [1]+list(i)

    if sum(1 for x in range(N-1) if tuple(sorted(l[x:x+2])) in E) == N-1:

        cnt += 1

print(cnt)
import itertools

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

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

cnt = 0

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

    l = [1]+list(i)

    cnt += sum(1 for x in zip(l,l[1:]) if tuple(sorted(x)) in D) == N-1

print(cnt)
import itertools

N, M = list(map(int, input().split()))
E = set([tuple(sorted(map(int, input().split()))) for x in range(M)])
cnt = 0
for i in itertools.permutations(list(range(2, N + 1)), N - 1):
    l = [1] + list(i)
    if sum(1 for x in range(N - 1) if tuple(sorted(l[x : x + 2])) in E) == N - 1:
        cnt += 1
print(cnt)

import itertools

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

-E = set([tuple(sorted(map(int, input().split()))) for x in range(M)]) +D = {tuple(sorted(map(int, input().split()))) for x in range(M)} -    if sum(1 for x in range(N - 1) if tuple(sorted(l[x : x + 2])) in E) == N - 1: -        cnt += 1 +    cnt += sum(1 for x in zip(l, l[1:]) if tuple(sorted(x)) in D) == N - 1