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:  # 始点は1でないといけないから

        break

    factor = 1

    for i in range(N-1):

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

    cnt += factor



print(cnt)
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



def dfs(v, used):

    if not False in used:

        return 1



    ans = 0

    for i in range(N):

        if not adj_matrix[v][i]:

            continue

        if used[i]:

            continue

        used[i] = True

        ans += dfs(i, used)

        used[i] = False        

    return ans



used = [False] * N

used[0] = True

print((dfs(0, used)))
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:  # 始点は1でないといけないから
        break
    factor = 1
    for i in range(N - 1):
        factor *= adj_matrix[each[i]][each[i + 1]]
    cnt += factor
print(cnt)

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


def dfs(v, used):
    if not False in used:
        return 1
    ans = 0
    for i in range(N):
        if not adj_matrix[v][i]:
            continue
        if used[i]:
            continue
        used[i] = True
        ans += dfs(i, used)
        used[i] = False
    return ans


used = [False] * N
used[0] = True
print((dfs(0, used)))

-import itertools - -# 隣接行列を作る -cnt = 0 -for each in itertools.permutations(list(range(N))): -    if each[0] != 0:  # 始点は1でないといけないから -        break -    factor = 1 -    for i in range(N - 1): -        factor *= adj_matrix[each[i]][each[i + 1]] -    cnt += factor -print(cnt) + + +def dfs(v, used): +    if not False in used: +        return 1 +    ans = 0 +    for i in range(N): +        if not adj_matrix[v][i]: +            continue +        if used[i]: +            continue +        used[i] = True +        ans += dfs(i, used) +        used[i] = False +    return ans + + +used = [False] * N +used[0] = True +print((dfs(0, used)))