def ary(r, c, v): return [[v for _ in range(c)] for _ in range(r)]

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

e = ary(n, n, False)

for i in range(m):

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

    #頂点を0-indexedに変換

    a -= 1

    b -= 1

    e[a][b] = True

    e[b][a] = True

ps = set()

ps.add('0')



for cnt in range(1, n):

    t = set()

    for p in ps:

        for i in map(str, list(range(1, n))):

            if not(i in p):

                t.add(p + i)

    ps = t.copy()



ans = 0

for p in ps:

    flg = True

    for i in range(n - 1):

        a = int(p[i])

        b = int(p[i + 1])

        if not e[a][b]:

            flg = False

            break

    if flg:

        ans += 1



print(ans)
def main():

    import sys



    sys.setrecursionlimit(10 ** 7)



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



    g = tuple(set() for _ in range(N))

    for _ in range(M):

        a, b = (int(x) - 1 for x in input().split())

        g[a].add(b)

        g[b].add(a)



    def dfs(v=0, visited=1 << 0):

        if visited == (1 << N) - 1:

            return 1



        ret = 0

        for u in g[v]:

            if (visited >> u) & 1:

                continue

            ret += dfs(u, visited | (1 << u))

        return ret



    ans = dfs()

    print(ans)





if __name__ == '__main__':

    main()



# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()

# int(input())

# map(int, input().split())

def ary(r, c, v):
    return [[v for _ in range(c)] for _ in range(r)]


n, m = list(map(int, input().split()))
e = ary(n, n, False)
for i in range(m):
    a, b = list(map(int, input().split()))
    # 頂点を0-indexedに変換
    a -= 1
    b -= 1
    e[a][b] = True
    e[b][a] = True
ps = set()
ps.add("0")
for cnt in range(1, n):
    t = set()
    for p in ps:
        for i in map(str, list(range(1, n))):
            if not (i in p):
                t.add(p + i)
    ps = t.copy()
ans = 0
for p in ps:
    flg = True
    for i in range(n - 1):
        a = int(p[i])
        b = int(p[i + 1])
        if not e[a][b]:
            flg = False
            break
    if flg:
        ans += 1
print(ans)

def main():
    import sys

    sys.setrecursionlimit(10**7)
    N, M = list(map(int, input().split()))
    g = tuple(set() for _ in range(N))
    for _ in range(M):
        a, b = (int(x) - 1 for x in input().split())
        g[a].add(b)
        g[b].add(a)

    def dfs(v=0, visited=1 << 0):
        if visited == (1 << N) - 1:
            return 1
        ret = 0
        for u in g[v]:
            if (visited >> u) & 1:
                continue
            ret += dfs(u, visited | (1 << u))
        return ret

    ans = dfs()
    print(ans)


if __name__ == "__main__":
    main()
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

-def ary(r, c, v): -    return [[v for _ in range(c)] for _ in range(r)] +def main(): +    import sys + +    sys.setrecursionlimit(10**7) +    N, M = list(map(int, input().split())) +    g = tuple(set() for _ in range(N)) +    for _ in range(M): +        a, b = (int(x) - 1 for x in input().split()) +        g[a].add(b) +        g[b].add(a) + +    def dfs(v=0, visited=1 << 0): +        if visited == (1 << N) - 1: +            return 1 +        ret = 0 +        for u in g[v]: +            if (visited >> u) & 1: +                continue +            ret += dfs(u, visited | (1 << u)) +        return ret + +    ans = dfs() +    print(ans) -n, m = list(map(int, input().split())) -e = ary(n, n, False) -for i in range(m): -    a, b = list(map(int, input().split())) -    # 頂点を0-indexedに変換 -    a -= 1 -    b -= 1 -    e[a][b] = True -    e[b][a] = True -ps = set() -ps.add("0") -for cnt in range(1, n): -    t = set() -    for p in ps: -        for i in map(str, list(range(1, n))): -            if not (i in p): -                t.add(p + i) -    ps = t.copy() -ans = 0 -for p in ps: -    flg = True -    for i in range(n - 1): -        a = int(p[i]) -        b = int(p[i + 1]) -        if not e[a][b]: -            flg = False -            break -    if flg: -        ans += 1 -print(ans) +if __name__ == "__main__": +    main() +# import sys +# +# sys.setrecursionlimit(10 ** 7) +# +# input = sys.stdin.readline +# rstrip() +# int(input()) +# map(int, input().split())