#include <bits/stdc++.h>
using namespace std;
static const long long mod = 1000000007;
vector<long long> a(100000), d(100001);
bool exist(long long n) { return find(a.begin(), a.end(), n) != a.end(); }
long long fib(long long i) {
  if (i == 0) return d[i] = 1;
  if (i == 1) return (exist(i) ? 0 : 1);
  if (exist(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;
  cin >> N >> M;
  for (long long i = 0; i < M; i++) cin >> a[i];
  cout << fib(N) << endl;
}
