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