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

public class AtCoderC
{
    private static int n;
    private static int m;
    private static int[] broken;
    private static long[] patterns;
    private static long mod = 1000000007;
    static void Main()
    {
        {
            string line = Console.ReadLine();
            var words = line.Split(' ');
            n = int.Parse(words[0]);
            m = int.Parse(words[1]);
        }

        broken = new int[m];
        {
            for (int i = 0; i < m; i++)
            {
                broken[i] = int.Parse(Console.ReadLine());
            }
        }

        patterns = new long[n + 1];
        patterns[0] = 1;
        patterns[1] = broken.Contains(1) ? 0 : 1;
        long answer = Solve(n);
        Console.WriteLine(answer);
    }

    private static long Solve(int n)
    {
        if (broken.Contains(n))
        {
            patterns[n] = 0;
            return 0;
        }
        if (patterns[n] != 0)
        {
            return patterns[n];
        }
        long pattern = (Solve(n - 1) + Solve(n - 2)) % mod;
        patterns[n] = pattern;
        return pattern;
    }
}