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

E = [[] for _ in range(N)]

for m in range(M):

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

    a -= 1

    b -= 1

    E[a].append(b)

    E[b].append(a)



check = [False] * N

check[0] = True

def dfs(v):

    if sum(check) == N:

        return 1

    ans = 0

    for u in E[v]:

        if check[u]:

            continue

        check[u] = True

        ans += dfs(u)

        check[u] = False

    return ans

print((dfs(0)))

from itertools import permutations



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

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

for _ in range(M):

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

    E[a-1].add(b-1)

    E[b-1].add(a-1)



ans = 0

for p in permutations([i for i in range(1, N)]):

    i = 0

    for j in p:

        if j not in E[i]:

            break

        i = j

    else:

        ans += 1

print(ans)
N, M = list(map(int, input().split()))
E = [[] for _ in range(N)]
for m in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    E[a].append(b)
    E[b].append(a)
check = [False] * N
check[0] = True


def dfs(v):
    if sum(check) == N:
        return 1
    ans = 0
    for u in E[v]:
        if check[u]:
            continue
        check[u] = True
        ans += dfs(u)
        check[u] = False
    return ans


print((dfs(0)))

from itertools import permutations

N, M = list(map(int, input().split()))
E = [set() for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    E[a - 1].add(b - 1)
    E[b - 1].add(a - 1)
ans = 0
for p in permutations([i for i in range(1, N)]):
    i = 0
    for j in p:
        if j not in E[i]:
            break
        i = j
    else:
        ans += 1
print(ans)

+from itertools import permutations + -E = [[] for _ in range(N)] -for m in range(M): +E = [set() for _ in range(N)] +for _ in range(M): -    a -= 1 -    b -= 1 -    E[a].append(b) -    E[b].append(a) -check = [False] * N -check[0] = True - - -def dfs(v): -    if sum(check) == N: -        return 1 -    ans = 0 -    for u in E[v]: -        if check[u]: -            continue -        check[u] = True -        ans += dfs(u) -        check[u] = False -    return ans - - -print((dfs(0))) +    E[a - 1].add(b - 1) +    E[b - 1].add(a - 1) +ans = 0 +for p in permutations([i for i in range(1, N)]): +    i = 0 +    for j in p: +        if j not in E[i]: +            break +        i = j +    else: +        ans += 1 +print(ans)