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

namespace program
{
    class Program
    {
        static void Main()
        {
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int N = input[0], M = input[1];

            long Pattern = 1;
            int pre = -1;
            int A_i;
            int count;long p;
            for (int i = 0; i < M; i++)
            {
                A_i = int.Parse(Console.ReadLine());
                
                count = A_i - pre - 2;
                if (count < 0) { Pattern = 0; break; }

                p = 0;
                for (int k = 0; count - 2*k >=0; k++)
                {
                    p += Comb.Combination(count - k, k);
                }
                Pattern = Pattern * p % 1000000007;
                pre = A_i;
            }

            A_i = N+1;

            count = A_i - pre - 2;

            p = 0;
            for (int k = 0; count - 2 * k >= 0; k++)
            {
                p += Comb.Combination(count - k, k);
            }
            Pattern = Pattern * p % 1000000007;

            Console.WriteLine($"{Pattern}");
            Console.ReadKey();
        }

    }

    static class Comb
    {
        const int MAX = 510000;
        const int MOD = 1000000007;
        static long[] fac = new long[510000];
        static long[] finv = new long[510000];
        static long[] inv = new long[510000];

        static private void init()
        {
            fac[0] = fac[1] = 1;
            finv[0] = finv[1] = 1;
            inv[1] = 1;
            for (int i = 2; i < MAX; i++)
            {
                fac[i] = fac[i - 1] * i % MOD;
                inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
                finv[i] = finv[i - 1] * inv[i] % MOD;
            }
        }

        static Comb() { init(); }

        static public long Combination(int n, int k)
        {
            if (n < k) return 0;
            if (n < 0 || k < 0) return 0;
            return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
        }
    }
    
}
