#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>

using namespace std;
int main(){
int N;
cin >> N;
int M;
cin >>M;

int safe[N+1]={};
int bstair;
for(int i=1;i<=M;i++){
cin >>bstair;
safe[bstair]=-1;
}
long long stair[N+1]={};
stair[0]=1;

for(int i=0;i<N;i++){
if(safe[i+2]!=-1 && i<N-1){
stair[i+2]+=stair[i];
}
if(safe[i+1]!=-1){
stair[i+1]+=stair[i];
}
}
stair[N]%=1000000007;



cout <<stair[N] <<endl;
 return 0;
}