#include <bits/stdc++.h>
using namespace std;

const long long mod = 1e9 + 7;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> broken(n + 1);

    for (int i = 0; i < M; i++) {
        int aa; cin >> aa;
        a[i] = aa;
        broken[a] = 1;
    }

    vector<int> dp(N + 1);
    dp[0] = 1;
    for (int j = 0; j < N; j++) {
        if (broken[i]) dp[j] = 0;
        else dp[j] = dp[j + 1] + dp[j + 2] % mod;
    }

    cout << dp[N] << endl;
    return 0;
}