#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const ll mod = 1e9 + 7;
const int INF = (1 << 30) - 1;
const ll INFLL = (1LL << 62) - 1;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  bool flg = false;
  for (int i = 0; i < M; ++i) {
    cin >> A[i];
    if (0 < i) {
      if (A[i - 1] == A[i] - 1) {
        flg = true;
        break;
      }
    }
  }
  if (flg) {
    cout << 0 << endl;
  } else {
    vector<ll> dp(N + 1);
    for (int i = 0; i <= N; ++i) {
      if (i <= 1) {
        dp[i] = 1;
        continue;
      }
      auto skip = find(A.begin(), A.end(), i);
      auto skip2 = find(A.begin(), A.end(), i - 1);
      auto skip3 = find(A.begin(), A.end(), i - 2);
      if (skip == A.end()) {
        if (skip2 != A.end() || skip3 != A.end()) {
          dp[i] = dp[i - 1];
        } else {
          dp[i] = dp[i - 1] + dp[i - 2];
        }
      } else {
        dp[i] = dp[i - 1];
      }
    }
    ll result = dp[N] % 1000000007;
    cout << result << endl;
  }
}
