#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<bool> ng(m);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    ng[a] = true;
  }
  const ll mod = 1e9 + 7;
  vector<ll> memo(n + 1, -1);
  memo[0] = 1;
  function<ll(int)> f = [&](int n) -> ll {
    if (n < 0) return 0;
    if (memo[n] != -1) return memo[n];
    if (ng[n]) return 0;
    return memo[n] = (f(n - 1) + f(n - 2)) % mod;
  };
  cout << f(n) << endl;
  return 0;
}
