#include <bits/stdc++.h>
using namespace std;
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;
int main() {
  long long N, M;
  cin >> N >> M;
  long long dp[100010];
  bool A[100010];
  for (int i = 0; i < 100010; i++) {
    A[i] = false;
  }
  for (int i = 0; i < M; i++) {
    long long a;
    cin >> a;
    A[a] = true;
  }
  dp[0] = 0;
  dp[1] = 1;
  dp[2] = 2;
  if (A[1]) {
    dp[1] = 0;
    dp[2] = 1;
  }
  if (A[2]) {
    dp[2] = 0;
  }
  for (int i = 3; i <= N; i++) {
    if (A[i - 1] && A[i - 2]) {
      long long ans = 0;
      break;
    } else if (A[i - 1]) {
      dp[i] = dp[i - 2];
    } else if (A[i - 2]) {
      dp[i] = dp[i - 1];
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  long long pre_ans = dp[N];
  long long ans = (pre_ans % 1000000007);
  cout << ans << endl;
}
