#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using Pt = pair<int, int>;
void ABC129C() {
  ll MOD = 1000000007;
  int N, M;
  cin >> N >> M;
  set<int> a;
  for (int i = 0; i < M; ++i) {
    int x;
    cin >> x;
    a.insert(x);
  }
  vl ct(N + 1);
  ct[0] = ct[1] = 1;
  for (int i = 2; i <= N; ++i) {
    ct[i] = a.find(i) == a.end() ? ct[i - 1] + ct[i - 2] : 0;
    ct[i] %= MOD;
  }
  cout << ct[N] << endl;
}
int main() {
  ABC129C();
  return 0;
}
