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

class Program
{
    static void Main(string[] args)
    {
        const long INF = 1L << 60;
        var a = new HashSet<int>();
        var dp = new long[1000010];

        var input = Console.ReadLine().Split(" ").Select(int.Parse).ToArray();
        int N = input[0], M = input[1];

        for (var i = 0; i < M; i++) a.Add(int.Parse(Console.ReadLine()));
        for (var i = 0; i < 1000010; i++) dp[i] = 0;

        dp[0] = 1;

        for (var i = 1; i <= N; i++)
        {
            if (a.Contains(i)) continue;

            if (i > 1 && !a.Contains(i - 1) && !a.Contains(i - 2))
            {
                dp[i] = dp[i - 2] + dp[i - 1];
            } else if (i > 1 && !a.Contains(i - 2))
            {
                dp[i] = dp[i - 2];
            } else if (!a.Contains(i - 1))
            {
                dp[i] = dp[i - 1];
            }
        }
        
        Console.WriteLine(dp[N] % 1000000007);
    }
}
