#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
const ll MOD7 = 1000000007;
ll dp[100010];
int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> holes(M), broken(N + 1, 1);
  for (ll i = 0; i < M; i++) {
    cin >> holes[i];
    broken[holes[i]] = 0;
    if (i > 0) {
      if (holes[i] - holes[i - 1] == 1) {
        cout << 0 << "\n";
        return 0;
      }
    }
  }
  for (ll i = 0; i < 100010; i++) dp[i] = 0;
  dp[N] = 1;
  dp[N - 1] = 1;
  for (ll i = N - 2; i >= 0; --i) {
    if (broken[i]) {
      dp[i] = dp[i + 1] + dp[i + 2];
      dp[i] %= MOD7;
    }
  }
  cout << dp[0] << "\n";
  return 0;
}
