#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;

int N, M;
int a[(int)1e5];
int const mod = 1e9 + 7;

int main() {
    cin >> N >> M;
    rep(i, M) cin >> a[i];

    vector<int> broken(N + 1);
    int dp[N + 2] = {0};

    rep(i, M) {
        broken[a[i]] = 1;
    }

    dp[N] = 1;
    // cout << dp[0] << endl;
    for (int i = N - 1; i >= 0; i--) {
        if (broken[i] == 1) {
            dp[i] = 0;
            continue;
        }

        dp[i] = (dp[i + 1] + dp[i + 2]) % mod;
        printf("dp[i + 1] %d dp[i + 2] %d\n", dp[i + 1], dp[i + 2]);
    }

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