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

namespace A
{
    class Program
    {

        public static int nCm(int n, int m)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * nCm(n - 1, m - 1) / m;
        }

        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int N = int.Parse(str[0]);
            int M = int.Parse(str[1]);
            int[] a = new int[M];
            for(int i = 0; i < M; i++)
            {
                a[i] = int.Parse(Console.ReadLine());
            }

            int[] gap = new int[M + 1];
            gap[0] = a[0];
            for(int i = 1; i < M; i++)
            {
                gap[i] = a[i] - a[i - 1] - 1;
            }
            gap[M] = N - a[M - 1];


            int result = 0;

            for(int i = 0; i < M + 1; i++)
            {
                if (gap[i] % 2 == 1)
                {
                    for (int j = 0; j <= (gap[i] - 1) / 2; j++)
                    {
                        result += nCm(gap[i] - j - 1, j);
                    }
                }
                else
                {
                    for (int j = 0; j <= (gap[i] - 2) / 2; j++)
                    {
                        result += nCm(gap[i] - j - 1, j);
                    }
                }
               
            }

            result = result % 1000000007;

            Console.Write(result);
        }
    }
}
