using System;
using System.Collections.Generic;

class ABC_129_C
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        int N = int.Parse(input[0]);
        int M = int.Parse(input[1]);

        int[] A = new int[M];
        for (int i = 0; i < M; i++)
        {
            A[i] = int.Parse(Console.ReadLine());
            if(i>0 && A[i-1]+1==A[i])
            {
                Console.WriteLine(0);
                return;
            }
        }

        int bi = M==0 ? -1: 0;
        long[] pattern = new long[N+1];
        pattern[0] = 1L;
        for (int i = 0; i < N; i++)
        {
            if (bi >= 0 && bi < M && A[bi] == i)
            {
                pattern[i] = 0;
                bi++;
            }

            pattern[i+1] += pattern[i];
            if(i+1<N) pattern[i+2] += pattern[i];
        }

        Console.WriteLine(pattern[N] % 1000000007L);
    }
}