#include <iostream>
#include <unordered_set>
#include <algorithm>
using namespace std;

int main()
{
    int N, M;
    cin >> N >> M;
    unordered_set<int> A;
    for (int i = 0; i < M; ++i) {
        int a;
        cin >> a;
        A.insert(a);
    }

    vector<int> dp(N + 1, 0);
    dp[0] = 1;
    for (int i = 1; i <= N; ++i) {
        if (find(A.begin(), A.end(), i) != A.end()) {
            continue;
        }
        if (find(A.begin(), A.end(), i - 1) == A.end()) {
            dp[i] = dp[i - 1];
        }
        if (find(A.begin(), A.end(), i - 2) == A.end()) {
            if (i - 2 >= 0)
            dp[i] = (dp[i] + dp[i - 2]) % 1000000007;
        }
    }
    cout << dp[N] << endl;

    return 0;
}