using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000

int main() {
    int N, M;
    cin >> N >> M;
    vector<ll> dp(N + 1, 0);
    ll MOD = 1000000007;
    dp[0] = 0;
    vector<bool> broken(N + 1, false);
    rep(i, M) {
        int a;
        cin >> a;
        broken[a] = true;
    }

    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i <= N; i++) {
        if (!broken[i - 1])
            dp[i] += dp[i - 1];
        if (!broken[i - 2])
            dp[i] += dp[i - 2];

        dp[i] %= MOD;
    }

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