# サンプルコード計算量お試し



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)
import itertools



def resolve():

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

    S = [[0] * n for i in range(n)]



    for i in range(m):

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

        S[a - 1][b - 1] = 1

        S[b - 1][a - 1] = 1



    ans = 0

    for p in itertools.permutations(list(range(n))):

        if p[0] != 0:

            break

        tmp = 1

        for i in range(n-1):

            tmp *= S[p[i]][p[i + 1]]

        ans += tmp



    print(ans)



if __name__ == '__main__':

    resolve()
# サンプルコード計算量お試し
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)

import itertools


def resolve():
    n, m = list(map(int, input().split()))
    S = [[0] * n for i in range(n)]
    for i in range(m):
        a, b = list(map(int, input().split()))
        S[a - 1][b - 1] = 1
        S[b - 1][a - 1] = 1
    ans = 0
    for p in itertools.permutations(list(range(n))):
        if p[0] != 0:
            break
        tmp = 1
        for i in range(n - 1):
            tmp *= S[p[i]][p[i + 1]]
        ans += tmp
    print(ans)


if __name__ == "__main__":
    resolve()

-# サンプルコード計算量お試し -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) + +def resolve(): +    n, m = list(map(int, input().split())) +    S = [[0] * n for i in range(n)] +    for i in range(m): +        a, b = list(map(int, input().split())) +        S[a - 1][b - 1] = 1 +        S[b - 1][a - 1] = 1 +    ans = 0 +    for p in itertools.permutations(list(range(n))): +        if p[0] != 0: +            break +        tmp = 1 +        for i in range(n - 1): +            tmp *= S[p[i]][p[i + 1]] +        ans += tmp +    print(ans) + + +if __name__ == "__main__": +    resolve()