
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace CP
{
    class Atria
    {
        readonly static long mod = 1000000000 + 7;
        static void Main(string[] args)
        {
            int[] s = ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = s[0];
            int m = s[1];
            var ls = new List<int>();
            for (int i = 0; i < m; i++)
            {
                ls.Add(int.Parse(ReadLine()));
            }

            long[] dp = new long[n + 2];
            dp[n] = 1;
            for (int i = n - 1; i >= 0; i--)
            {
                if (ls.Contains(i))
                {
                    dp[i] = 0;
                }
                else
                {
                    dp[i] = (dp[i + 1] + dp[i + 2]) % mod;
                }
            }
            WriteLine(dp[0]);
        }
    }
}