#include <bits10_1.h/stdc++.h>
using namespace std;
int main()
{
    int N, M;
    cin >> N;
    cin >> M;
    int a[M];
    int ai[N];
    for(int i = 0; i < N; ++i){
        ai[i] = 1;
    }
    for(int i = 0; i < M; ++i){
        cin >> a[i];
        ai[a[i]] = 0;
    }

    int dp[N];
    dp[0] = 1;
    if(ai[1] == 0) dp[1] = 0;
    else dp[1] = 1;

    for(int i = 2; i < N; ++i){
        dp[i] = (dp[i-1]*ai[i-1] + dp[i-2]*ai[i-1])%1000000007;
    }

    cout << dp[N-1];
}