#include <bits/stdc++.h>
#define fst first
#define snd second
#define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I))
#define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i))
#define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i))
#define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i))
#define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i))
#define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i))
#define el cout<<endl
#define es cout<<" "
#define dump(x) cout<<" "<<#x<<"="<<x
#define pdump(p) cout<<" "<<#p<<"=("<<p.fst<<","<<p.snd<<")"
#define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl
using namespace std; using lint = long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<lint, lint>;
template<class T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<class T, class... Ts> 
auto make_vec(size_t a, Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));}

int main(void) {
    int n; cin >> n;
    vector<bool> b(n + 1, false);
    int m; cin >> m;
    repeat (i, m) {
        int t; cin >> t;
        b[t] = true;
    }
    vector<int> dp(n + 1, 0);
    const int MOD = 1e9 + 7;
    dp[0] = dp[1] = 1;
    if (n == 1) {cout << 1 << endl; return 0;}
    if (dp[1]) dp[1] = 0;
    repeat_from_to (i, 2, n) {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= MOD;
        if (b[i]) dp[i] = 0;
    }
    cout << dp[n] << endl;
    return 0;
}
