#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
long long dp[100100] = {};
const long long MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  for (int i = 0; i <= N + 1; i++) {
    dp[i] = 0;
  }
  dp[0] = 1;
  vector<int> is_broken(N);
  for (int i = 0; i <= N; i++) {
    is_broken[i] = 0;
  }
  for (int i = 0; i < M; i++) {
    is_broken[a[i]] = 1;
  }
  for (int i = 0; i < N; i++) {
    if (is_broken[i] == 0) {
      if (is_broken[i + 1] == 0) {
        dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
      }
      if (is_broken[i + 2] == 0) {
        dp[i + 2] = (dp[i + 2] + dp[i]) % MOD;
      }
    }
  }
  cout << dp[N] << endl;
  return 0;
}
