#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
int n, m;
long long ans;
int a[100005];
long long dp[100005];
int main() {
  a[0] = 1;
  cin >> n >> m;
  for (int i = (int)(0); i < (int)(m); ++i) {
    int tmp;
    cin >> tmp;
    a[tmp] = 1;
  }
  dp[0] = 1;
  if (a[1])
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = (int)(2); i < (int)(n + 1); ++i) {
    if (a[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  dp[n] %= mod;
  cout << dp[n] << endl;
  return 0;
}
