from itertools import permutations

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

list_AB = [ list(map(int,input().split(" "))) for i in range(m)]

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

list_N = [i for i in range(2, n+1)]



for a, b in list_AB:

    list_MAP[a-1][b-1] = 1

    list_MAP[b-1][a-1] = 1



ans = 0



for l in permutations(list_N, n-1):

    cnt = 0

    p = 1

    q = 0

    for num in l:

        q = num

        cnt += list_MAP[p-1][q-1]

        p = num



    if cnt == n-1:

        ans += 1



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

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

for _ in range(m):

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

    list_MAP[a-1][b-1] = 1

    list_MAP[b-1][a-1] = 1



dp = [[0]*n for _ in range(1<<n)]

dp[1][0] = 1

for num in range(1<<n):

    for v in range(n):

        if num & (1<<v) == 0:

            continue

        sub = num ^ (1<<v)



        for u in range(n):

            if sub & (1<<u) and list_MAP[v][u]:

                dp[num][v] += dp[sub][u]

ans = sum(dp[(1 << n) - 1][u] for u in range(1, n))

print(ans)
from itertools import permutations

n, m = list(map(int, input().split()))
list_AB = [list(map(int, input().split(" "))) for i in range(m)]
list_MAP = [[0] * n for _ in range(n)]
list_N = [i for i in range(2, n + 1)]
for a, b in list_AB:
    list_MAP[a - 1][b - 1] = 1
    list_MAP[b - 1][a - 1] = 1
ans = 0
for l in permutations(list_N, n - 1):
    cnt = 0
    p = 1
    q = 0
    for num in l:
        q = num
        cnt += list_MAP[p - 1][q - 1]
        p = num
    if cnt == n - 1:
        ans += 1
print(ans)

n, m = list(map(int, input().split()))
list_MAP = [[0] * n for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    list_MAP[a - 1][b - 1] = 1
    list_MAP[b - 1][a - 1] = 1
dp = [[0] * n for _ in range(1 << n)]
dp[1][0] = 1
for num in range(1 << n):
    for v in range(n):
        if num & (1 << v) == 0:
            continue
        sub = num ^ (1 << v)
        for u in range(n):
            if sub & (1 << u) and list_MAP[v][u]:
                dp[num][v] += dp[sub][u]
ans = sum(dp[(1 << n) - 1][u] for u in range(1, n))
print(ans)

-from itertools import permutations - -list_AB = [list(map(int, input().split(" "))) for i in range(m)] -list_N = [i for i in range(2, n + 1)] -for a, b in list_AB: +for _ in range(m): +    a, b = list(map(int, input().split())) -ans = 0 -for l in permutations(list_N, n - 1): -    cnt = 0 -    p = 1 -    q = 0 -    for num in l: -        q = num -        cnt += list_MAP[p - 1][q - 1] -        p = num -    if cnt == n - 1: -        ans += 1 +dp = [[0] * n for _ in range(1 << n)] +dp[1][0] = 1 +for num in range(1 << n): +    for v in range(n): +        if num & (1 << v) == 0: +            continue +        sub = num ^ (1 << v) +        for u in range(n): +            if sub & (1 << u) and list_MAP[v][u]: +                dp[num][v] += dp[sub][u] +ans = sum(dp[(1 << n) - 1][u] for u in range(1, n))