using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

class Program
{
    void Run()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int m = sc.NextInt();
        int[] a = new int[m];
        for (int i = 0; i < m; i++) a[i] = sc.NextInt();
        int res = 0;
        int mod = 1000000007;
        long[] c = new long[n + 1];
        c[0] = m > 0 && a[0] == 0 ? 0 : 1;
        c[1] = m > 0 && a[0] == 1 ? 0 : 1;
        for (int i = 2; i <= n; i++)
        {
            if (Array.BinarySearch(a, i) >= 0) continue;
            c[i] = c[i - 1] + c[i - 2];
        }
        Console.WriteLine(c[n] % mod);
    }

    static void Main(string[] args)
    {
        new Program().Run();
    }

    static long Gcd(long a, long b)

    {
        if (a < b) return Gcd(b, a);
        if (b == 0) return a;
        return Gcd(b, a % b);
    }
}

class Scanner
{
    int index = -1;
    string[] buf;

    public Scanner()
    {
    }

    public int NextInt()
    {
        CheckNext();
        return int.Parse(buf[index++]);
    }

    public long NextLong()
    {
        CheckNext();
        return long.Parse(buf[index++]);
    }

    public double NextDouble()
    {
        CheckNext();
        return double.Parse(buf[index++]);
    }

    public string NextString()
    {
        CheckNext();
        return buf[index++];
    }

    private void CheckNext()
    {
        if (index >= 0 && index < buf.Length) return;

        buf = Console.ReadLine().Split(' ');
        index = 0;
    }
}
