import itertools


N, M = map(int, input().split())
edges = set(tuple(map(int, input().split())) for _ in range(M))

ans = 0
for route in itertools.permutations(range(2, N + 1)):
    ok = True
    last = 1
    for next in route:
        if (min(last, next), max(last, next)) not in edges:
            ok = ok and False
        last = next
    if ok:
        ans += 1

print(ans)
