#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = 1e9 + 7;
double EPS = 1e-8;
template <typename T>
T chmax(T& a, const T& b) {
  return a = (a > b ? a : b);
}
template <typename T>
T chmin(T& a, const T& b) {
  return a = (a < b ? a : b);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> dp(n + 1, 0);
  vector<int> ng(n + 1);
  for (int i = (0); i < (int)(m); i++) {
    int a;
    cin >> a;
    ng[a] = 1;
  }
  dp[0] = 1;
  for (int i = (0); i < (int)(n); i++) {
    if (ng[i + 1] == 0) (dp[i + 1] += dp[i]) %= MOD;
    if (ng[i + 2] == 0) (dp[i + 2] += dp[i]) %= MOD;
  }
  cout << dp[n] << endl;
  return 0;
}
