#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
using namespace std;
long long dp[100005];
long long stair(long long now) {
  if (dp[now] != -1) {
    return dp[now];
  }
  if (dp[now - 1] == 0) {
    dp[now] = stair(now - 2) % MOD;
  } else if (dp[now - 2] == 0) {
    dp[now] = stair(now - 1) % MOD;
  } else {
    dp[now] = (stair(now - 2) % MOD + stair(now - 1) % MOD) % MOD;
  }
  return 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (int i = 0; i < (n + 1); i++) dp[i] = -1;
  for (int i = 0; i < (m); i++) cin >> a[i];
  sort((a).begin(), (a).end());
  long long then = a[0];
  dp[0] = 1;
  dp[1] = 1;
  dp[a[0]] = 0;
  for (int i = 1; i < a.size(); i++) {
    if (then == a[i]) {
      cout << 0 << endl;
      return 0;
    }
    dp[a[i]] = 0;
    then = a[i];
  }
  for (long long i = 2; i < n + 1; i++) {
    if (dp[i] != 0) {
      stair(i);
    }
  }
  cout << dp[n] % MOD << endl;
  return 0;
}
