#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    long long int k=b;
    long long int broken[b],dp[a+2]={0};
    dp[a]=1;
    for(int i=0;i<b;i++) cin>>broken[i];
    for(int i=a-1;i>=0;i--){
        if(i==broken[k-1]){
            dp[i]=0;
            k--;
        }
        else dp[i]=(dp[i+1]+dp[i+2])%1000000007;
    }
    cout<<dp[0]<<endl;
}
