#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> f(100000, 0);
  f[0] = 1;
  f[1] = 2;
  for (long long i = 2; i < 100000; i++)
    f[i] = (f[i - 1] + f[i - 2]) % 1000000007;
  long long m;
  cin >> m;
  vector<bool> b(n, true);
  long long ans = 1;
  for (long long i = 0; i < m; i++) {
    long long a;
    cin >> a;
    b[a - 1] = false;
    if (a != 1) {
      if (b[a - 2] == false && b[a - 1] == false) ans = 0;
    }
  }
  long long count = 0;
  if (b[0] == true) count++;
  for (long long i = 1; i < n; i++) {
    if (b[i] == true) {
      if (b[i - 1] == true) {
        count++;
      } else {
        count = 0;
      }
    } else {
      ans *= f[count - 1];
      ans %= 1000000007;
    }
  }
  ans *= f[count - 1] % 1000000007;
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
