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

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

    cout << ans << endl;

    return 0;
}
