#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define LEN 1000000007

int main(){
    long N, M;
    cin >> N >> M;

    vector<long> flag(N+1, 0);
    long a = 0;
    for(long i = 0; i < M; i++){
        cin >> a;
        flag[a]++;
    }

    vector<long long> dp(N+1, 0);
    dp[1] = 1;
    dp[2] = 2;
    if(flag[1]){
        dp[1]--;
        dp[2]--;
    }
    if(flag[2]){
        f[2] = 0;
    }
    for(long j = 3; j <= N; j++){
        if(flag[j]){
            continue;
        }else{
            dp[j] = dp[j-1] + dp[j-2]; 
        }
    }

    cout << dp[N] % LEN << endl;

    return 0;
}