#include<bits/stdc++.h>
using namespace std;
long long D = 1000000007;

int main(){
int n,m,tmp = 0;
cin >> n >> m;
long long sta[n] = {0};
long long a[n+1] = {0};
a[0] = 1;//昇り口

for(int i=0;i<m;i++){
  cin >> tmp;
  sta[tmp]+=1;
}

for(int i=0;i<n+1;i++){
  if(i != 0 && sta[i] == 1) continue;
  if(i+1 < n+1){
    if(sta[i+1] != 1) a[i+1]+=a[i];
  }
  if(i+2 < n+1){
    if(sta[i+2] != 1) a[i+2]+=a[i];
  }
} 
cout << a[n]%D << endl;
}

