using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = l[0], M = l[1];

            var broke = new int[M];
            for (var i = 0; i < M; i++)
            {
                broke[i] = int.Parse(Console.ReadLine());
            }

            // 例外ケースをはじいておく
            for (var i = 1; i < M; i++)
            {
                if (broke[i] - broke[i-1] == 1)
                {
                    Console.WriteLine(0);
                    return;
                }
            }

            var df = new DfsMaster(N);
            var total = 1L;
            for (var i = 0; i < M; i++)
            {
                if (i == 0)
                {
                    total *= df.Fib(broke[i]);
                    continue;
                }
                total *= df.Fib(broke[i] - broke[i - 1] - 1);
            }
            total *= df.Fib(N - broke[M - 1]);

            Console.WriteLine(total % 1000000007);

        }
    }
    public class DfsMaster
    {
        public int[] Memo { get; set; }

        public DfsMaster(int x)
        {
            Memo = new int[x];
        }

        public int Fib(int n)
        {
            if (n == 0) return 0;
            if (n == 1) return 1;
            if (Memo[n] != 0) return Memo[n];

            return Memo[n] = Fib(n - 1) + Fib(n - 2);

        }
    }
}
