using static System.Console;

public class Hello
{
    public static void Main()
    {
        var l = ReadLine();
        int N = int.Parse(l.Split()[0]);
        int M = int.Parse(l.Split()[1]);
        int[] A = new int[N];
        long sum = 0;
      	const int p = 1000000007;

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

        }

        for (int i = 0; i < M + 1; i++)
        {
            if (i == 0) sum = Fib(A[i] - 1) %p;            
            else if (i < M){           
            sum *= Fib(A[i] - A[i - 1] - 2);
            sum %=p;            
            }
            else{
            sum *=Fib(N - A[M-1] - 1); 
            sum %=p;
            }
        }

        WriteLine(sum % p);

    }

    public static int Fib(int n)
    {
        if (n == 0 || n==1) return 1;
        if (n == 2) return 2;
        if (n > 2) return Fib(n - 1) + Fib(n - 2);
        return 0;
    }

}