#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll INF = 1000000007;
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> a(M);
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  a.push_back(N + 1);
  vector<ll> dp(100000);
  for (ll i = 0; i < M; i++) {
    if (a[i] == a[i + 1] - 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (ll i = 0; i < 100000; i++) {
    if (i == 0 || i == 1) {
      dp[i] = 1;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= INF;
    }
  }
  ll ans = 1;
  for (ll i = 0; i <= M; i++) {
    if (i == 0) {
      ans *= dp[a[i] - 1];
      ans %= INF;
    } else {
      ans *= dp[a[i] - a[i - 1] - 2];
      ans %= INF;
    }
  }
  cout << ans << endl;
}
