from itertools import permutations



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



Matrix = [[False for i in range(N)] for j in range(N)]



for i in range(M) :

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

    a -= 1

    b -= 1

    Matrix[a][b] = True

    Matrix[b][a] = True



for i in range(N) :

    Matrix[i][i] = True



arange = list(range(2,N+1))



ans = 0

for pm in permutations(arange) :

    pm = [1] + list(pm)

    for row,col in zip(pm,pm[1:]) :

        row -= 1

        col -= 1

        if not Matrix[row][col] :

            break

    else :

        ans += 1

print(ans)

from itertools import permutations



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



Matrix = [[False for x in range(N)] for y in range(N)]

for i in range(N) :

    Matrix[i][i] = True

for i in range(M) :

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

    a -= 1

    b -= 1

    Matrix[a][b] = True

    Matrix[b][a] = True



arange = permutations(list(range(1,N)))

ans = 0

for i in arange :

    pm = [0] + list(i)

    for a,b in zip(pm, pm[1:]) :

        if not Matrix[a][b] :

            break

    else :

        ans += 1

print(ans)

from itertools import permutations

N, M = list(map(int, input().split()))
Matrix = [[False for i in range(N)] for j in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    Matrix[a][b] = True
    Matrix[b][a] = True
for i in range(N):
    Matrix[i][i] = True
arange = list(range(2, N + 1))
ans = 0
for pm in permutations(arange):
    pm = [1] + list(pm)
    for row, col in zip(pm, pm[1:]):
        row -= 1
        col -= 1
        if not Matrix[row][col]:
            break
    else:
        ans += 1
print(ans)

from itertools import permutations

N, M = list(map(int, input().split()))
Matrix = [[False for x in range(N)] for y in range(N)]
for i in range(N):
    Matrix[i][i] = True
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    Matrix[a][b] = True
    Matrix[b][a] = True
arange = permutations(list(range(1, N)))
ans = 0
for i in arange:
    pm = [0] + list(i)
    for a, b in zip(pm, pm[1:]):
        if not Matrix[a][b]:
            break
    else:
        ans += 1
print(ans)

-Matrix = [[False for i in range(N)] for j in range(N)] +Matrix = [[False for x in range(N)] for y in range(N)] +for i in range(N): +    Matrix[i][i] = True -for i in range(N): -    Matrix[i][i] = True -arange = list(range(2, N + 1)) +arange = permutations(list(range(1, N))) -for pm in permutations(arange): -    pm = [1] + list(pm) -    for row, col in zip(pm, pm[1:]): -        row -= 1 -        col -= 1 -        if not Matrix[row][col]: +for i in arange: +    pm = [0] + list(i) +    for a, b in zip(pm, pm[1:]): +        if not Matrix[a][b]: