#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
map<T, T> primeFactor(T n) {
  map<T, T> res;
  for (T i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n] = 1;
  return res;
}
template <typename T>
bool IsPrimeNumber(T num) {
  if (num <= 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ll n, m, a, ans = 1;
  const ll mod = 1000000007;
  cin >> n;
  cin >> m;
  vll s(n + 1, 0), t(n + 1, 1);
  for (long i = 0; i < m; i++) {
    cin >> a;
    if (s[a - 1] == 1 || s[a + 1] == 1) {
      cout << 0 << '\n';
      return 0;
    }
    s[a] = 1;
  }
  for (long i = 1; i <= n; i++) {
    if (s[i] == 0) {
      if (t[i - 1] != 0) {
        t[i] = (t[i - 1] + t[i - 2]);
        if (t[i] > mod) {
          t[i] %= mod;
        }
      }
    } else {
      t[i] = 0;
      ans = (ans * t[i - 1]);
      if (ans > mod) {
        ans %= mod;
      }
    }
    if (ans == 0) {
      cout << "a" << '\n';
    }
  }
  ans = (ans * t[n]) % mod;
  cout << ans << '\n';
  return 0;
}
