using System;

namespace AtCoderABC129C
{
    class Program
    {
        static void Main(string[] args)
        {
            int MOD = 1000000007;
            long ans = 1;

            string[] s = Console.ReadLine().Split(' ');

            int N = int.Parse(s[0]);
            int M = int.Parse(s[1]);

            int[] X = new int[M + 1];
            int[] A = new int[M + 1];

            int F = int.Parse(Console.ReadLine());

            X[0] = F;

            for (int i = 1; i < M; i++)
            {
                int T = int.Parse(Console.ReadLine());
                X[i] = T - F - 1;
                F = T;
            }

            X[M] = N - F;

            Array.Sort(X);

            if(X[0] == 0)
            {
                Console.WriteLine("0");
                return;
            }

            int V1 = 0;
            int V2 = 1;
            int index = 1;

            for(int i=0;i<M+1;i++)
            {
                while(X[i] != index)
                {
                    int temp = (V1 + V2) % MOD;
                    V1 = V2;
                    V2 = temp;

                    index++;
                }

                A[i] = V2;
            }

            for (int i = 0; i < M+1;i++)
            {
                ans = (ans * A[i]) % MOD;
            }

            Console.WriteLine(ans.ToString());
        }
    }
}
