#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

#define MOD 1000000007


int res(int N, set<int> a, vector<int> &fib){
  if(fib.at(N) != -1) return fib.at(N);
  if(!isok.at(N)) return fib.at(N);

  if(N == 1) return fib.at(N) = 1;
  if(N == 0) return fib.at(N) = 1;

  return fib.at(N) = (res(N-1, a, fib) % MOD + res(N-2, a, fib) %MOD) % MOD;
}

int main(){
  int N, M;
  cin >> N >> M;
  set<int> a;
  vector<int> fib(N+1, -1);
  vector<bool> isok(N+1, true);
  for(int i = 0; i < M; i++){
    int aa;
    cin >> aa;
    isok.at(aa) = false;
    fib.at(aa) = 0;
  }
  cout << res(N, a, fib) << endl;
}
