#include <bits/stdc++.h>
using namespace std;
uint64_t N, M;
int64_t a;
uint64_t *ans;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M;
  ans = new uint64_t[N + 1]();
  ans[0] = 1;
  ans[1] = 1;
  bool *ng = new bool[N + 1];
  for (int i = 0; i < M; ++i) {
    cin >> a;
    ans[N - a] = 0;
    ng[N - a] = true;
  }
  for (int i = 2; i < N + 1; ++i) {
    if (ng[i]) {
    } else {
      ans[i] += ans[i - 2] % 1000000007ULL;
      ans[i] += ans[i - 1] % 1000000007ULL;
    }
  }
  cout << ans[N] << "\n";
  return 0;
}
