#include <bits/stdc++.h>
#define vin vector<long long>
#define vch vector<char>
#define vst vector<string>
#define vbo vector<bool>
#define vvin vector<vel>
#define vvch vector<vech>
#define int long long
#define pin pair<int,int>
#define ppin pair<int,pin>
#define mkp make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define maxel(vec, j) *max_element(vec.begin(), vec.begin()+j)

using namespace std;
void mmin(int &a, int b) { a = min(a, b); }
void mmax(int &a, int b) { a = max(a, b); }
int vsum(vin v){ return accumulate(v.begin(), v.end(), 0); }
int msum(vvin v){
    int ans = 0;
    rep(i, v.size()){
        ans += vsum(v[i]);
    }
    return ans;
}
const int MOD = 1000000007;
signed main() {
    int N, M;
    cin >> N >> M;
    vector<bool> ok(n+1, true);
    rep(i, M)
        int a;
        cin >> a;
        ok[a] = false;
    }
 
    vin dp(n+1, 0);
    dp[0] = 1;
    rep(i, N+1){
        // 1つ下から
        if(ok[i-1]){
            dp[i] += dp[i-1];
            dp[i] %= MOD;
        }
        // 2つ下から
        if(i > 1 && ok[i-2]){
            dp[i] += dp[i-2];
            dp[i] %= MOD;
        }
    }
    cout << dp[N] << endl;
 
    return 0;
}
/*
 *
 *
6 1
3
 */
