//#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  int a[m];
  for(int i=0;i<m;i++) cin >> a[i];
  long long dp[n];
  for(int i=0;i<n+1;i++){
    dp[i] = 0;
  }
  dp[0] = 1;
  for(int i=0;i<m;i++) d[a[i]] = -1;
  if(a[0] != 1){
    dp[1] = 1;
  }
  else{
    dp[1] = 0;
  }
  for(int i=2;i<n+1;i++){
    if(dp[i] < 0) dp[i] = 0;
    else{
      dp[i] = dp[i-1]%1000000007 + dp[i-2]%1000000007;
    }
  }
  cout << dp[n]%1000000007 << endl;

  return 0;
}