#include <bits/stdc++.h>
using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

 
int main() {
  int N, M;
  cin >> N >> M;
  vector<LL> A(N+1,1);
  REP(i,M) {
    int b;
    cin >> b;
    A,at(b) = 0;
  }
  REP(i,N-1) {
    if (A.at(i+2) != 0) {
      A.at(i+2) = A.at(i) + A.at(i+1);
      A.at(i+2) %= 1000000007;
    }
  }
  cout << A.at(N) << endl;
  return 0;
}