#include <stdio.h>
#include<math.h>
#include<bitset>
#include<string>
#include<iostream>
#include<vector>
#include<string.h>
#include<algorithm>
#include <iomanip>
using namespace std;
//m=0とn揃えよう

long long fib(long long n){
    n++;
    double tmp;
    long long ans;
    tmp={pow((1+sqrt(5))/2,n)-pow((1-sqrt(5))/2,n)};
    tmp/=sqrt(5);
    ans={static_cast<long long>(tmp)};
    return ans;
}


long long DPFibonacci(long long x){
	long long dp[x] = {0};
	dp[0] = 0;
	dp[1] = 1;
	for(int i = 2; i < x; i++){
		dp[i] =(dp[i-1] + dp[i-2])%1000000007;
	}
	return dp[x-1];
}




int main()
{
    bool flag=true;
    long long n,m,ans;
    cin>>n>>m;
    vector<int>a(m);
    if(m!=0)cin>>a[0];
    for(int i=1;i<m;i++){
        cin>>a[i];
        if(a[i]-a[i-1]==1){
            flag=false;
            break;
        }
    }
    
    if(m!=0){
        
        
    ans=DPFibonacci(a[0]+1)%1000000007;
    for(int i=1;i<m;i++){
        ans*=DPFibonacci(a[i]-a[i-1])%1000000007;
    }
    ans*=DPFibonacci(n-a[m-1]+1)%1000000007;
    
    if(flag==true) cout<<ans%1000000007<<endl;
    else cout<<0<<endl;
    
    }else{
        cout<<DPFibonacci(n+2)%1000000007<<endl;
    }

    return 0;
}
