#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N, M;
    cin >> N >> M;
    vector<bool> broken(N + 1);
 
    for (int i = 0; i < M; i++) {
        int a; cin >> a;
        broken[a] = true;
    }
 
    vector<int> dp(N + 2);
    const long long mod = 1e9 + 7;
    dp[0] = 1;
    for (int j = n - 1; j >= 0; j--) {
        if (broken[j]) dp[j] = 0;
        else dp[j] = dp[j + 1] + dp[j + 2] % mod;
    }
    cout << dp[0] << endl;
    return 0;
}
