using System;
using System.Collections.Generic;
using System.Linq;
class Program{
    static void Main(string[] args){
    var vals = Console.ReadLine().Split().Select(x => int.Parse(x)).ToList();
    int N=vals[0];
    int M=vals[1];
    int mod=1000000007;
    long[] d=new long[N+1];
    int[] a=new int[M];
    for(int i=0;i<M;i++){
        a[i]=int.Parse(Console.ReadLine());
    }
    int k=0;
    d[0]=1;
    if(a[0]==1){d[1]=0;k++;}
    else d[1]=1;
    for(int i=1;i<N;i++){
        if((i+1)!=a[k]) d[i+1]=(d[i]+d[i-1])%mod;
        else{
            d[i+1]=0;
            if(k<M-1)k++;
        }
    }
    Console.Write(d[N]);
    }
}