#include <bits/stdc++.h>
using namespace std;
int n,m;
#define mod 1000000007
#define ll long long
vector<int> br;
vector<ll> DP;

ll dp(int i){
  if(i==n) return 1;
  if(i>n) return 0;
  if(br[i]==1) return 0;
  if(DP[i]!=-1) return DP[i];
  return DP[i]=(dp(i+1)+dp(i+2))%mod;
}

int main(){
  scanf("%d %d",&n,&m);
  br.resize(n+1,0);
  for(int i=0;i<m;i++){
    int a;
    scanf("%d",&a);
    br[a]=1;
  }

  DP.resize(n+1,-1);
  printf("%lld\n",dp(0));

  return 0;
}
