#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
const ll INF = 1e18;
inline void chmax(ll& a, ll b) { a = max(a, b); }
inline void chmin(ll& a, ll b) { a = min(a, b); }
ll dp[100005];
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> A(m);
  for (ll i = 0; i < (m); ++i) cin >> A[i];
  dp[0] = 1;
  for (ll i = 0; i < (m); ++i) {
    dp[A[i]] = -1;
  }
  if (m != 0) {
    if (A[0] == 1)
      dp[1] = 0;
    else
      dp[1] = 1;
  }
  for (ll i = 2; i <= n; i++) {
    if (dp[i] == -1)
      dp[i] = 0;
    else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007ll;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
