import itertools



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

h = [[0]*n for _ in range(n)]

for i in range(m):

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

    h[a-1][b-1] = 1

    h[b-1][a-1] = 1



ans = 0

x = list(itertools.permutations(list(range(1, n+1))))

for i in range(len(x)):

    if x[i][0] == 1:

        for j in range(n-1):

            if h[x[i][j]-1][x[i][j+1]-1] == 0:

                break

        else:

            ans += 1

print(ans)
import itertools



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

g = [[0]*n for _ in range(n)]

for _ in range(m):

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

    a, b = a-1, b-1

    g[a][b] = 1

    g[b][a] = 1



a = list(itertools.permutations(list(range(n))))

ans = 0

for i in a:

    if i[0] != 0:

        break

    for j in range(n-1):

        if g[i[j]][i[j+1]] == 0:

            break

    else:

        ans += 1

print(ans)
import itertools

n, m = list(map(int, input().split()))
h = [[0] * n for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    h[a - 1][b - 1] = 1
    h[b - 1][a - 1] = 1
ans = 0
x = list(itertools.permutations(list(range(1, n + 1))))
for i in range(len(x)):
    if x[i][0] == 1:
        for j in range(n - 1):
            if h[x[i][j] - 1][x[i][j + 1] - 1] == 0:
                break
        else:
            ans += 1
print(ans)

import itertools

n, m = list(map(int, input().split()))
g = [[0] * n for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    g[a][b] = 1
    g[b][a] = 1
a = list(itertools.permutations(list(range(n))))
ans = 0
for i in a:
    if i[0] != 0:
        break
    for j in range(n - 1):
        if g[i[j]][i[j + 1]] == 0:
            break
    else:
        ans += 1
print(ans)

-h = [[0] * n for _ in range(n)] -for i in range(m): +g = [[0] * n for _ in range(n)] +for _ in range(m): -    h[a - 1][b - 1] = 1 -    h[b - 1][a - 1] = 1 +    a, b = a - 1, b - 1 +    g[a][b] = 1 +    g[b][a] = 1 +a = list(itertools.permutations(list(range(n)))) -x = list(itertools.permutations(list(range(1, n + 1)))) -for i in range(len(x)): -    if x[i][0] == 1: -        for j in range(n - 1): -            if h[x[i][j] - 1][x[i][j + 1] - 1] == 0: -                break -        else: -            ans += 1 +for i in a: +    if i[0] != 0: +        break +    for j in range(n - 1): +        if g[i[j]][i[j + 1]] == 0: +            break +    else: +        ans += 1