using System;
using System.Linq;

namespace abc129
{
    class C
    {
        static public long[] memo;

        static void Main(string[] args)
        {
            const int MOD = 1000000007;

            var input = Input.IntArray();
            var N = input[0];
            var M = input[1];

            C.memo = new long[N + 1];
            C.memo[0] = 1;
            C.memo[1] = 1;

            long res = 1;

            int now = 0;
            for (int i = 0; i < M; i++)
            {
                int holl = Input.Int();
                // 着地後も穴
                if (holl == now) {
                    Console.WriteLine(0);
                    return;
                }

                res = (res * C.getPattern(holl - now - 1)) % MOD;
                now = holl + 1;
            }

            res = (res * C.getPattern(N - now)) % MOD;

            Console.WriteLine(res);

        }

        static long getPattern(long num)
        {
            if (C.memo[num] == 0) {
                C.memo[num] = C.getPattern(num - 1) + C.getPattern(num - 2);
            }
            return C.memo[num];
        }

        /** Input Class */
        internal static class Input
        {
            /** input int */
            public static int Int() => int.Parse(Console.ReadLine());

            /** input str */
            public static string Str() => Console.ReadLine();

            /** input array of int */
            public static int[] IntArray() => Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            /** input array of string */
            public static string[] StrArray() => Input.Str().Split(' ');

            /** input array of char */
            public static char[] charArray() => Input.Str().ToCharArray();
        }

    }
}
