#include <iostream>
#include <algorithm>
#define rep(i,n) for(ll i = 0; i < (ll)(n); ++i)
using namespace std;
using ll = long long;
const int mod = 1e9+7;

int main()
{
    int n,m;
    cin >> n >> m ;
    int a[m]={0};
    rep(i,m) cin >> a[i];
    int brk[n+1] = {0};
    rep(i,m) brk[a[i]] ++;
    
    int dp[n+1]={0};
    if( brk[1] == 0 && brk[2] == 0 ){
        dp[1]=1;
        dp[2]=2;
    } 
    else if( brk[1] == 0 && brk[2] != 0 ){
        dp[1]=1;
        dp[2]=0;
    } 
    else if( brk[1] != 0 && brk[2] == 0 ){
        dp[1]=0;
        dp[2]=1;
    } 
    for( int i=3; i < n+1; i++){
        if( brk[i] == 0 ){
            //count
            dp[i] += dp[i-1];
            dp[i] %=mod;
            dp[i] += dp[i-2];
            dp[i] %=mod;
        }
    }

    cout << dp[n] << endl;

    return 0;
}
