#include <bits/stdc++.h>
using namespace std;
int res(int N, set<int> a, vector<int> &fib, vector<bool> isok) {
  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, isok) % 1000000007 +
                      res(N - 2, a, fib, isok) % 1000000007) %
                     1000000007;
}
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, isok) << endl;
}
