#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, M;
  cin >> N >> M;
  vector<int64_t> a(M);
  for (int64_t i = 0; i < M; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<int64_t> x(N + 1);
  x[0] = 0;
  x[1] = 1;
  x[2] = 1;
  for (int64_t i = 3; i < N + 1; i++) {
    x[i] = (x[i - 1] + x[i - 2]) % 1000000007;
  }
  if (M == 0) {
    cout << x[N] << endl;
    return 0;
  }
  for (int64_t i = 1; i < M; i++) {
    if (a[i] == a[i - 1] + 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  int64_t ans = 1;
  for (int64_t i = 0; i < M; i++) {
    if (i == 0) {
      ans = (ans % 1000000007) * (x[a[i]] % 1000000007);
    } else {
      ans = (ans % 1000000007) * (x[a[i] - a[i - 1] - 1] % 1000000007);
    }
  }
  ans = (ans % 1000000007) * (x[N - a[M - 1]] % 1000000007);
  cout << ans % 1000000007 << endl;
  return 0;
}
