using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();
        int m = sc.NextInt();

        bool[,] route = new bool[n + 1, n + 1];
        for (int i = 0; i < m; i++)
        {
            int a = sc.NextInt();
            int b = sc.NextInt();
            route[a, b] = true;
            route[b, a] = true;
        }

        List<int[]> nums = AllPermutation<int>(Enumerable.Range(1, n).ToArray());

        int answer = 0;

        foreach (var num in nums)
        {
            if (num[0] != 1)
            {
                continue;
            }

            bool ok = true;
            for (int i = 0; i < n - 1; i++)
            {
                if (!route[num[i], num[i + 1]])
                {
                    ok = false;
                    break;
                }
            }
            if (ok)
            {
                answer++;
            }
        }

        Console.WriteLine(answer);
    }

    // 順列生成
    private static List<T[]> AllPermutation<T>(params T[] array) where T : IComparable
    {
        var arr = new List<T>(array).ToArray();
        var ret = new List<T[]>();
        ret.Add(new List<T>(arr).ToArray());
        var length = arr.Length;
        var next = true;
        while (next)
        {
            next = false;
            int i;
            for (i = length - 2; i >= 0; i--)
            {
                if (arr[i].CompareTo(arr[i + 1]) < 0)
                {
                    break;
                }
            }
            if (i < 0)
            {
                break;
            }
            var j = length - 1;
            while (arr[i].CompareTo(arr[j]) > 0)
            {
                j--;
            }
            if (arr[i].CompareTo(arr[j]) < 0)
            {
                var tmp = arr[i];
                arr[i] = arr[j];
                arr[j] = tmp;
                Array.Reverse(arr, i + 1, length - i - 1);
                ret.Add(new List<T>(arr).ToArray());
                next = true;
            }
        }
        return ret;
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 22232