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;

        int index = 2;
        while (index <= n)
        {
            long pattern = (patterns[index - 1] + patterns[index - 2]) % mod;
            if (broken.Contains(index))
            {
                pattern = 0;
            }
            patterns[index] = pattern;
            index++;
        }
        long answer = patterns[n];
        Console.WriteLine(answer);
    }
}