#include <iostream>
#include <vector>



int main()
{
    int N, M;
    std::cin >> N >> M;
    std::vector<long long> dp(N, 0);

    int a;
    for (int i = 0; i < M; i++) {
        std::cin >> a;
        dp[a] = -1;
    }
    
    if (dp[N-1] == 0) {
        dp[N-1] = 1;
        if (a.find(N-2) == std::end(a)) {
            dp[N-1] = 2;
        }
    }
    else {
        if (a.find(N-2) == std::end(a)) {
            dp[N-1] = 1;
        }
        else {
            dp[N-1] = 0;
        }
    }

    for (int i = N-1; i <= 0; i--) {
        if (dp[i] == -1) continue;

        if (i + 1 < N && dp[i+1] != -1) {
            dp[i] += dp[i+1];
        }

        if (i + 2 < N && dp[i+2] != -1) {
            dp[i] += dp[i+2];
        } 
    }

    long long ans = dp[0] % 1000000007;

    std::cout << ans << std::endl;

    return 0;
}