#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define LargeNum 1000000007;
int main(){
    int N, M, tmp;
    long long ans=0;
    cin >> N >> M;
    bool a[N]={};
    long long b[N] = {};
    rep(i, M) {
        cin >> tmp;
        a[tmp-1] = 1;
    }
    if (N==1) {
        if(M==0)ans = 1;
    }
    else{
        bool flag = true;
        rep(i, N-1){
            if(a[i+1] == 1 && a[i]==1) flag=false;
        }
        if(flag){
            if(a[0] == 0) b[0] = 1;
            else b[0] = 0;
            if(a[1] == 0) b[1] = b[0] + 1;
            else{
                b[1] = 0;
            }
            for (int i = 2; i<N; i++){
                if(a[i]==0) b[i] = b[i-1] + b[i-2];
                else b[i] == 0;
            }
        }
        ans = b[N-1] % LargeNum;
    }
    cout << ans << endl;
    return 0;
}
