namespace ABC128.C
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using static System.Console;
    using static System.Math;


    public static class Program

    {
        public static readonly int mod = 1000000007;
        public static void Main(string[] args)
        {
            checked
            {
                var l1 = ReadInputsAsInt().ToList();
                var n = l1[0];
                var m = l1[1];
                var broken = ReadLinesAsInt(m).ToList();
                WriteLine(Solve(n, m, broken));
            }
        }

        static IEnumerable<int> ReadInputsAsInt() => ReadLine().Split(' ').Select(x => int.Parse(x));
        static int ReadInputAsInt() => int.Parse(ReadLine());


        static IEnumerable<int> ReadLinesAsInt(int lines)
        {

            for (int i = 0; i < lines; i++)
            {
                yield return int.Parse(ReadLine());
            }

        }

        public static int Solve(int n, int m, List<int> broken)
        {
            checked
            {
                var notBrokens = new List<int>();

                var brokenspace = broken
                    .Take(broken.Count - 1)
                    .Select((k, i) => broken[i + 1] - k - 1).ToList();
                brokenspace.Insert(0, broken[0] == 1 ? 1 : broken[0] - 1);
                brokenspace.Add(n - broken.Last());

                long prod = 1;

                foreach (var item in brokenspace)
                {
                    if (item == 0) return 0;

                    if (item == 1 || item == 2) continue;

                    prod = (prod * (GetPatternCount(item) % mod)) % mod;
                }
                return (int)prod;
            }
        }

        public static long GetPatternCount(int stages)
        {
            checked
            {
                long patterns = 0;
                for (int i = 0; i <= stages / 2; i++)
                {
                    var two_s = i;
                    var one_s = stages - two_s;

                    if (two_s == 0 || one_s == 0)
                    {
                        patterns += 1;
                        continue;
                    }
                    long pattern = Pattern(stages, two_s, one_s) % mod;
                    patterns += pattern;
                }
                return patterns;

            }
        }

        public static long Pattern(int s, int t, int o)
        {
            checked
            {
                var larger = Max(t, o);
                var smaller = Min(t, o);


                long _bunshi = 1;
                for (int i = s; i >= larger + 1; i--)
                {
                    _bunshi *= i;
                }
                long bunbo = 1;
                for (int i = 1; i <= smaller; i++)
                {
                    bunbo *= i;
                }
                return _bunshi / bunbo;
            }
        }

    }
}
