#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1'000'000'007

int n, m;
vector<int> a(0);
vector<int> memo(100000, -1);

int notin(int value, const vector<int>& list) {
    return find(list.begin(), list.end(), value) == list.end();
}

int dp(int i) {
    if (i == n - 1) {
        return 1;
    }
    if (i == n - 2) {
        return 1 + notin(n - 1, a);
    }
    if (memo.at(i) != -1) {
        return memo.at(i);
    }
    memo.at(i) = (dp(i + 1) * notin(i + 1, a) % MOD + dp(i + 2) * notin(i + 2, a) % MOD) % MOD;
    return memo.at(i);
}

int main() {
    cin >> n >> m;
    a = vector<int>(m);
    rep(i, m) {
        cin >> a.at(i);
    }

    cout << dp(0) << endl;
    return 0;
}