#include <bits/stdc++.h>
using namespace std;
static const int mod = 1e9 + 7;
vector<long long> d(100001);
vector<bool> a(100000, false);
long long fib(long long i) {
  if (!i) return d[i] = 1;
  if (i == 1) return d[i] = (a[i] ? 0 : 1);
  if (a[i]) return d[i] = 0;
  if (d[i] > 0) return d[i];
  return d[i] = (fib(i - 1) + fib(i - 2)) % mod;
}
int main() {
  long long N, M, A;
  cin >> N >> M;
  for (long long i = 0; i < M; i++) {
    cin >> A;
    a[A] = true;
  }
  cout << fib(N) << endl;
}
