import itertools



def sonzai(path, start, goal):

    for i in path:

        if start in i:

            if start > goal:

                if i[0] == goal:

                    return True

            else:

                if i[1] == goal:

                    return True

    return False



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

path = []

for i in range(m):

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

    path.append([a, b])

ans = 0

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

    if not sonzai(path, 1, i[0]):

        continue

    for j in range(n - 1):

        if j == n - 2:

            ans += 1

            break

        if not sonzai(path, i[j], i[j + 1]):

            break

print(ans)
import itertools



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

graph = [[0 for i in range(n)] for j in range(n)]

for i in range(m):

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

    graph[a - 1][b - 1] = 1

    graph[b - 1][a - 1] = 1

ans = 0

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

    if not graph[0][i[0] - 1]:

        continue

    for j in range(n - 1):

        if j == n - 2:

            ans += 1

            break

        if not graph[i[j] - 1][i[j + 1] - 1]:

            break

print(ans)
import itertools


def sonzai(path, start, goal):
    for i in path:
        if start in i:
            if start > goal:
                if i[0] == goal:
                    return True
            else:
                if i[1] == goal:
                    return True
    return False


n, m = list(map(int, input().split()))
path = []
for i in range(m):
    a, b = list(map(int, input().split()))
    path.append([a, b])
ans = 0
for i in itertools.permutations(list(range(2, n + 1))):
    if not sonzai(path, 1, i[0]):
        continue
    for j in range(n - 1):
        if j == n - 2:
            ans += 1
            break
        if not sonzai(path, i[j], i[j + 1]):
            break
print(ans)

import itertools

n, m = list(map(int, input().split()))
graph = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    graph[a - 1][b - 1] = 1
    graph[b - 1][a - 1] = 1
ans = 0
for i in itertools.permutations(list(range(2, n + 1))):
    if not graph[0][i[0] - 1]:
        continue
    for j in range(n - 1):
        if j == n - 2:
            ans += 1
            break
        if not graph[i[j] - 1][i[j + 1] - 1]:
            break
print(ans)

- -def sonzai(path, start, goal): -    for i in path: -        if start in i: -            if start > goal: -                if i[0] == goal: -                    return True -            else: -                if i[1] == goal: -                    return True -    return False - - -path = [] +graph = [[0 for i in range(n)] for j in range(n)] -    path.append([a, b]) +    graph[a - 1][b - 1] = 1 +    graph[b - 1][a - 1] = 1 -    if not sonzai(path, 1, i[0]): +    if not graph[0][i[0] - 1]: -        if not sonzai(path, i[j], i[j + 1]): +        if not graph[i[j] - 1][i[j + 1] - 1]: