#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using pii = pair<int, int>;
template <class A, class B>
inline bool chmax(A &a, const B &b) {
  return b > a ? a = b, 1 : 0;
}
template <class A, class B>
inline bool chmin(A &a, const B &b) {
  return b < a ? a = b, 1 : 0;
}
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;
signed main() {
  int N, M;
  bool a[100010]{};
  cin >> N >> M;
  for (int i(0); i < int(M); ++i) {
    int x;
    cin >> x;
    a[x] = true;
  }
  i64 dp[100010];
  dp[0] = 1;
  for (int i(0); i < int(N + 1); ++i) {
    if (a[i]) continue;
    (dp[i + 1] += dp[i]) %= MOD;
    (dp[i + 2] += dp[i]) %= MOD;
  }
  cout << dp[N] << endl;
  return 0;
}
