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

namespace Contest
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            var NM = Console.ReadLine().Split().Select(int.Parse);
            int N = NM.First(), M = NM.Last();
            long ans = 1;
            int last = 0;
            for (int i = 0; i < M; i++)
            {
                int temp = int.Parse(Console.ReadLine());
                int diff = temp - last - 1;
                if (temp > 1)
                {
                    ans = ((ans * Fibonacci(diff)) % (long)(1e9 + 7));
                }
                last = temp + 1;
            }
            int final = N - last;
            ans = ((ans * Fibonacci(final)) % (long)(1e9 + 7));
            Console.WriteLine(ans);
        }

        static long Fibonacci(int diff)
        {
            int fib0 = 1, fib1 = 2;
            int fib = 0;
            switch (diff)
            {
                case 0:
                    fib = 0;
                    break;
                case 1:
                    fib = fib0;
                    break;
                case 2:
                    fib = fib1;
                    break;
                default:
                    for (int j = 2; j < diff; j++)
                    {
                        fib = (fib0 + fib1) % (int)(1e9 + 7);
                        fib0 = fib1;
                        fib1 = fib;
                    }
                    break;
            }
            return fib;
        }
    }
}
