#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
// Welcome to my source code!

const int MOD = 1e9+7;

int main() {
    int n, m;
    cin >> n >> m;
    int oks[n+1] = {};
    int a;
    for (int i = 0; i < m; i++) {
        cin >> a;
        oks[a] = true;
    }
    ll dp[n+1];
    dp[0] = 1;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j <= min(n, i+2); j++) {
            if (!oks[a]) {
                dp[j] += dp[i];
                dp[j] %= MOD;
            }
        }
    }
    cout << dp[n] << endl;
}