#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
const ll INF = 1LL << 60;
const ll MOD = 1'000'000'007;

int main(void){
    int n,m;
    cin >> n >> m;
    bool a[10010];
    REP(i,n+1) a[i]=true;
    REP(i,m) {
        int tmp;
        cin >> tmp;
        a[tmp]=false;
    }
    ll dp[10010]={0};
    dp[0]=1;
    if(a[1])dp[1]=1;
    for(int i=2;i<=n;i++){
        if(a[i])
            dp[i]=(dp[i-1]+dp[i-2])%MOD;
    }
    cout << dp[n] << endl;
    return 0;
}