#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<bool> usable(N + 1, true);
  for (int i = 0; i < M; ++i) {
    int in;
    cin >> in;
    usable[in] = false;
  }
  for (int i = 1; i < N + 1; ++i) {
    if ((!usable[i - 1] and !usable[i]) or !usable[0] or !usable[N]) {
      cout << 0 << endl;
      return 0;
    }
  }
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  vector<long long> dp(N + 1, 1);
  for (int i = 2; i < N + 1; ++i) {
    dp[i] = dp[i - 1];
    if (!usable[i]) continue;
    if (usable[i - 2] and usable[i - 1] and usable[i])
      dp[i] = dp[i - 2] + dp[i - 1];
  }
  cout << dp[N] % MOD << endl;
}
