#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
vector<long long> memo(1e5 + 5, -1);
const long long mod = 1e9 + 7;
long long calc(long long x, vector<long long> a, long long n) {
  if (memo[x] > -1) return memo[x];
  if (x > n) return 0;
  if (x == n) return 1;
  long long res = 0;
  if (x + 1 <= n && a[x + 1] == 0) res += calc(x + 1, a, n);
  res %= mod;
  if (x + 2 <= n && a[x + 2] == 0) res += calc(x + 2, a, n);
  res %= mod;
  memo[x] = res;
  return res;
}
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n + 1, 0);
  for (int i = 0; i < (m); i++) {
    long long x;
    cin >> x;
    a[x] = 1;
  }
  cout << calc(0, a, n) << endl;
  return 0;
}
