#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
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;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, m;
  cin >> N >> m;
  vector<int> check(N + 1, m);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    check[a] = false;
  }
  vector<long long> dp(N + 1);
  dp[0] = 1;
  for (int now = 0; now < N; now++) {
    for (int next = now + 1; next <= min(N, now + 2); next++) {
      if (check[next]) {
        dp[next] += dp[now];
        dp[next] %= MOD;
      }
    }
  }
  cout << (dp[N]) << endl;
}
