#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
  int N,M;
  cin >> N >> M;
  const = 1000000007;
  vector<int> p(N+2);
  vector<int> broken(M+1);
  
  for(int i=0;i<M;i++){
    int a;
    cin >> a;
    broken[a] = 1;
  }
  
  for(int i=N-1;i>=0;i--){
    if(broken[i] == 1){
      p[i] = 0;
      continue;
    }
    p[i] = (p[i+1]+p[i+2])%const;
  }
  
  cout << p[0] << endl;

}
