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

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = ReadArrayInt();
            var N = input[0];
            var M = input[1];
            var cnt = new long[N + 1];
            for (int i = 0; i < M; i++) cnt[ReadInt()] = -1;
            var mod = (int)Math.Pow(10, 9) + 7;
            if (cnt[1] != -1) cnt[1] = 1;
            if (cnt[2] != -1) cnt[2] = 1;
            for (int i = 1; i < N - 1; i++)
            {
                if (cnt[i] != -1)
                {
                    if (cnt[i + 1] != -1)
                    {
                        cnt[i + 1] += cnt[i];
                        cnt[i + 1] %= mod;
                    }
                    if (cnt[i + 2] != -1)
                    {
                        cnt[i + 2] += cnt[i];
                        cnt[i + 2] %= mod;
                    }
                }
            }
            if (cnt[N - 1] != -1)
            {
                cnt[N] += cnt[N - 1];
                cnt[N] %= mod;
            }

            Console.WriteLine(cnt[N]);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}