import itertools



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

adj_matrix = [[0]* N for _ in range(N)]



for i in range(M):

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

    adj_matrix[a-1][b-1] = 1

    adj_matrix[b-1][a-1] = 1



cnt = 0



for each in itertools.permutations(list(range(N))):

    if each[0] != 0:

        break

    factor = 1

    for i in range(N-1):

        factor *= adj_matrix[each[i]][each[i+1]]

    cnt += factor



print(cnt)
#bid DP

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



g = [[] for i in range(N)] #隣接リスト



for i in range(M):

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

    g[a-1].append(b-1)

    g[b-1].append(a-1)



memo = {}

All_used = (1 << N) -1



def dfs(v, used):

    if used == All_used:

        return 1

    

    key = (v, used)

    if key in memo:

        return memo[key]

    

    ans = 0

    for u in g[v]:

        if (used >> u) & 1 == 1:

            continue

        

        used ^= (1 << u)

        ans += dfs(u, used)

        used ^= (1 << u)

        

    memo[key] = ans

    return ans



print((dfs(0, 1)))
import itertools

N, M = list(map(int, input().split()))
adj_matrix = [[0] * N for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    adj_matrix[a - 1][b - 1] = 1
    adj_matrix[b - 1][a - 1] = 1
cnt = 0
for each in itertools.permutations(list(range(N))):
    if each[0] != 0:
        break
    factor = 1
    for i in range(N - 1):
        factor *= adj_matrix[each[i]][each[i + 1]]
    cnt += factor
print(cnt)

# bid DP
N, M = list(map(int, input().split()))
g = [[] for i in range(N)]  # 隣接リスト
for i in range(M):
    a, b = list(map(int, input().split()))
    g[a - 1].append(b - 1)
    g[b - 1].append(a - 1)
memo = {}
All_used = (1 << N) - 1


def dfs(v, used):
    if used == All_used:
        return 1
    key = (v, used)
    if key in memo:
        return memo[key]
    ans = 0
    for u in g[v]:
        if (used >> u) & 1 == 1:
            continue
        used ^= 1 << u
        ans += dfs(u, used)
        used ^= 1 << u
    memo[key] = ans
    return ans


print((dfs(0, 1)))

-import itertools - +# bid DP -adj_matrix = [[0] * N for _ in range(N)] +g = [[] for i in range(N)]  # 隣接リスト -    adj_matrix[a - 1][b - 1] = 1 -    adj_matrix[b - 1][a - 1] = 1 -cnt = 0 -for each in itertools.permutations(list(range(N))): -    if each[0] != 0: -        break -    factor = 1 -    for i in range(N - 1): -        factor *= adj_matrix[each[i]][each[i + 1]] -    cnt += factor -print(cnt) +    g[a - 1].append(b - 1) +    g[b - 1].append(a - 1) +memo = {} +All_used = (1 << N) - 1 + + +def dfs(v, used): +    if used == All_used: +        return 1 +    key = (v, used) +    if key in memo: +        return memo[key] +    ans = 0 +    for u in g[v]: +        if (used >> u) & 1 == 1: +            continue +        used ^= 1 << u +        ans += dfs(u, used) +        used ^= 1 << u +    memo[key] = ans +    return ans + + +print((dfs(0, 1)))