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

namespace ConsoleApp2
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int[] NM = Read(Console.ReadLine());
            int N = NM[0];
            int M = NM[1];

            int[] brokens = new int[M];

            double ans = 1;
            int lastBroken = -1;

            for (int i = 0; i < M; i++)
            {
                brokens[i] = int.Parse(Console.ReadLine());

                ans *= Stair(brokens[i] - lastBroken - 2);
                ans = ans % 1000000007;

                lastBroken = brokens[i];
            }

            ans*= Stair(N - lastBroken-1);
            ans = ans % 1000000007;






            Console.WriteLine(ans);
            

        }

        private static long Stair(int N)
        {
            if (N < 0) return 0;
            int twoM = N / 2;
            long ans = 0;
            for (int two = 0; two < twoM+1; two++)
            {
                int one = N - 2 * two;
                ans += Combination(one + two,two);
            }
            return ans;
        }

        private static long Combination(int N,int M)
        {
            
            long ans = Product(N) / (Product(M) * Product(N - M));
            return ans;

        }

        private static long Product(int N)
        {
            if (N == 0||N ==1) return 1;
            long ans = N;
            for (int i = 1; i < N; i++)
            {
                ans *= i;
            }
            return ans;
        }





        private static string ReplaceOneChar(string S ,int index,string newS)
        {
            string s1 = S.Substring(0, index-1);
            string s2 = S.Substring(index);
            return s1 + newS + s2;
        }

        private static int[] Read(string input)
        {
            string[] inputs = input.Split(' ');
            int num = inputs.Length;
            int[] ints = new int[num];
            for (int i = 0; i < num; i++)
            {
                ints[i] = int.Parse(inputs[i]);
            }
            
            return ints;
        }


    }


}
