#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include <algorithm>

using namespace std;
#define MAX 1000000007

long long memo[MAX];


long long dp(int N,int b[]){
    if(b[N] == -1)return 0; //N段目が壊れている場合
    else if(N==0 || N == 1) return memo[N] = 1;
    else if(memo[N]!= 0){/*cout << memo[N] << endl;*/return memo[N];}
    else return memo[N] = dp(N-1,b) + dp(N-2,b);
}
int main(){
    int N,M;
    cin >> N >> M;
    int a[M];
    int b[N];
    for(int i = 0;i < M;i++){
        cin >> a[i];
        b[a[i]] = -1;
        //cout << b[a[i]] << endl;
    }
    
    
    cout << dp(N,b)%MAX << endl;
    /*for(int i = 0;i < N;i++){
        cout << memo[i] << endl;
    }*/
}