#include <bits/stdc++.h>
using namespace std;
long long res(long long N, set<long long> a, vector<long long> &fib) {
  if (fib.at(N) != -1) 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) + res(N - 2, a, fib)) % 1000000007;
}
int main() {
  long long N, M;
  cin >> N >> M;
  set<long long> a;
  vector<long long> fib(N + 1, -1);
  for (int i = 0; i < M; i++) {
    long long aa;
    cin >> aa;
    a.insert(aa);
    fib.at(aa) = 0;
  }
  cout << res(N, a, fib) << endl;
}
