#include <bits/stdc++.h>

using namespace std;

int main(){
    long long int N,M,x,bk=0;
    cin >> N >> M;
    vector<int> a(M),sum(N+1);
    sum[0] = 1;
    sum[1] = 1;
    for(int i=0;i<M;i++){
        cin >> x;
        a[i] = x;
    }

    if(a[0]==1){
        sum[1] = 0;
        bk++;
    }

    if(N==1){
        if(M==0){
            cout << "1" << endl;
        }else{
            cout << "0" << endl;
        }
    }else{
        for(int i=2;i<N+1;i++){
        if(i == a[bk]){
            sum[i] = 0;
            bk++;
        }else{
            sum[i] = sum[i-2]+sum[i-1];
            sum[i] %= 1000000007;
        }

        cout << sum[N] << endl;
    }
}