from itertools import permutations



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



edges =[set() for _ in range(N)]

for _ in range(M):

    fr, to = list(map(int, input().split()))

    fr -= 1

    to -= 1

    edges[fr].add(to)

    edges[to].add(fr)



ans = 0

for perm in permutations(list(range(1, N)), r=N-1):

    for prev, now in zip((0,) + perm, perm):

        if not now in edges[prev]:

            break

    else:

        ans += 1



print(ans)

from itertools import permutations



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

edges = [set() for _ in range(N)]



for _ in range(M):

    fr, to = list(map(int, input().split()))

    fr -= 1

    to -= 1

    edges[fr].add(to)

    edges[to].add(fr)



def existsPath(path):

    for fr, to in zip(path, path[1:]):

        if not to in  edges[fr]:

            return False

    return True



ans = 0

for path in permutations(list(range(1, N)), r=N-1):

    if existsPath((0,) + path):

        ans += 1

print(ans)

from itertools import permutations

N, M = list(map(int, input().split()))
edges = [set() for _ in range(N)]
for _ in range(M):
    fr, to = list(map(int, input().split()))
    fr -= 1
    to -= 1
    edges[fr].add(to)
    edges[to].add(fr)
ans = 0
for perm in permutations(list(range(1, N)), r=N - 1):
    for prev, now in zip((0,) + perm, perm):
        if not now in edges[prev]:
            break
    else:
        ans += 1
print(ans)

from itertools import permutations

N, M = list(map(int, input().split()))
edges = [set() for _ in range(N)]
for _ in range(M):
    fr, to = list(map(int, input().split()))
    fr -= 1
    to -= 1
    edges[fr].add(to)
    edges[to].add(fr)


def existsPath(path):
    for fr, to in zip(path, path[1:]):
        if not to in edges[fr]:
            return False
    return True


ans = 0
for path in permutations(list(range(1, N)), r=N - 1):
    if existsPath((0,) + path):
        ans += 1
print(ans)

+ + +def existsPath(path): +    for fr, to in zip(path, path[1:]): +        if not to in edges[fr]: +            return False +    return True + + -for perm in permutations(list(range(1, N)), r=N - 1): -    for prev, now in zip((0,) + perm, perm): -        if not now in edges[prev]: -            break -    else: +for path in permutations(list(range(1, N)), r=N - 1): +    if existsPath((0,) + path):