from networkx import *
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
g = Graph(a)
ans = 0
for i in range(2, n + 1):
    for p in all_simple_paths(g, 1, i):
        if len(p) == n:
            ans += 1
print(ans)

3fbe0ff8b9d7f1296e7e689d3474d24118c60736
<mask token>

<mask token>
for i in range(2, n + 1):
    for p in all_simple_paths(g, 1, i):
        if len(p) == n:
            ans += 1
print(ans)

<mask token>
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
g = Graph(a)
ans = 0
for i in range(2, n + 1):
    for p in all_simple_paths(g, 1, i):
        if len(p) == n:
            ans += 1
print(ans)

from networkx import *
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
g = Graph(a)
ans = 0
for i in range(2, n + 1):
    for p in all_simple_paths(g, 1, i):
        if len(p) == n:
            ans += 1
print(ans)
