class Graph(): #non-directed

    def __init__(self,n,edge):

        self.n = n

        self.graph = [[] for _ in range(n)]

        self.deg = [0 for _ in range(n)]

        for e in edge:

            self.graph[e[0] - 1].append(e[1] - 1)

            self.graph[e[1] - 1].append(e[0] - 1)

            self.deg[e[0] - 1] += 1

            self.deg[e[1] - 1] += 1



from itertools import permutations



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

E = [tuple(map(int, input().split())) for _ in range(M)]



G = Graph(N, E)

res = 0



for p in permutations(list(range(N))):

    if p[0] != 0:

        continue

    for i in range(N - 1):

        if not p[i + 1] in G.graph[p[i]]:

            break

    else:

        res += 1



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

E = [tuple(map(int, input().split())) for _ in range(M)]



graph = [[0 for j in range(N)] for i in range(N)]



for e in E:

    graph[e[0] - 1][e[1] - 1] = 1

    graph[e[1] - 1][e[0] - 1] = 1



res = 0



dp = [[0 for j in range(N)] for i in range(2**N)]

dp[1][0] = 1



for i in range(2**N):

    for j in range(N):

        for k in range(N):

            if not (i >> k & 1) and graph[j][k]:

                dp[(i)|(1 << k)][k] += dp[i][j]



print((sum(dp[-1])))
class Graph:  # non-directed
    def __init__(self, n, edge):
        self.n = n
        self.graph = [[] for _ in range(n)]
        self.deg = [0 for _ in range(n)]
        for e in edge:
            self.graph[e[0] - 1].append(e[1] - 1)
            self.graph[e[1] - 1].append(e[0] - 1)
            self.deg[e[0] - 1] += 1
            self.deg[e[1] - 1] += 1


from itertools import permutations

N, M = list(map(int, input().split()))
E = [tuple(map(int, input().split())) for _ in range(M)]
G = Graph(N, E)
res = 0
for p in permutations(list(range(N))):
    if p[0] != 0:
        continue
    for i in range(N - 1):
        if not p[i + 1] in G.graph[p[i]]:
            break
    else:
        res += 1
print(res)

N, M = list(map(int, input().split()))
E = [tuple(map(int, input().split())) for _ in range(M)]
graph = [[0 for j in range(N)] for i in range(N)]
for e in E:
    graph[e[0] - 1][e[1] - 1] = 1
    graph[e[1] - 1][e[0] - 1] = 1
res = 0
dp = [[0 for j in range(N)] for i in range(2**N)]
dp[1][0] = 1
for i in range(2**N):
    for j in range(N):
        for k in range(N):
            if not (i >> k & 1) and graph[j][k]:
                dp[(i) | (1 << k)][k] += dp[i][j]
print((sum(dp[-1])))

-class Graph:  # non-directed -    def __init__(self, n, edge): -        self.n = n -        self.graph = [[] for _ in range(n)] -        self.deg = [0 for _ in range(n)] -        for e in edge: -            self.graph[e[0] - 1].append(e[1] - 1) -            self.graph[e[1] - 1].append(e[0] - 1) -            self.deg[e[0] - 1] += 1 -            self.deg[e[1] - 1] += 1 - - -from itertools import permutations - -G = Graph(N, E) +graph = [[0 for j in range(N)] for i in range(N)] +for e in E: +    graph[e[0] - 1][e[1] - 1] = 1 +    graph[e[1] - 1][e[0] - 1] = 1 -for p in permutations(list(range(N))): -    if p[0] != 0: -        continue -    for i in range(N - 1): -        if not p[i + 1] in G.graph[p[i]]: -            break -    else: -        res += 1 -print(res) +dp = [[0 for j in range(N)] for i in range(2**N)] +dp[1][0] = 1 +for i in range(2**N): +    for j in range(N): +        for k in range(N): +            if not (i >> k & 1) and graph[j][k]: +                dp[(i) | (1 << k)][k] += dp[i][j] +print((sum(dp[-1])))