#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 notin(int value, const vector<int>& list) {
    return find(list.begin(), list.end(), value) == list.end();
}

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

    vector<int> dp(n, -1);
    dp.at(n - 1) = 1;
    dp.at(n - 2) = 1 + notin(n - 1, a);
    for (int i = n - 3; i >= 0; i--) {
        dp.at(i) = (dp.at(i + 1) * notin(i + 1, a) % MOD + dp.at(i + 2) * notin(i + 2, a) % MOD) % MOD;
    }

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