#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
using ll = long long;
const int MAXN = 1e5;
const ll MOD = 1e9 + 7;
int n, m;
vector<bool> blocked;
ll dp[MAXN];
ll dfs(int x) {
  if (x > n) return 0;
  if (x == n) return 1;
  if (blocked[x]) return 0;
  if (dp[x]) return dp[x];
  dp[x] = (dfs(x + 1) + dfs(x + 2)) % MOD;
  return dp[x];
}
int main() {
  cin >> n >> m;
  blocked.resize(n);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    blocked[x] = true;
  }
  cout << dfs(0) << endl;
  return 0;
}
