#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;
}
double euclid_distance(double a, double b) { return sqrt(a * a + b * b); }
int gcd(long long int a, long long int b) {
  long long int r;
  if (a < b) {
    int tmp;
    tmp = a;
    a = b;
    b = tmp;
  }
  while (r = a % b) {
    a = b;
    b = r;
  }
  return a;
}
void Integer_factorization(long long int b, long long int n) {
  long long int a = 2;
  long long int count = 0;
  long long int ans = 1;
  long long int ndash = n;
  if (b == 1)
    cout << n << endl;
  else {
    while (ndash >= a * a) {
      if (n % a == 0) {
        count++;
        n /= a;
        if (count % b == 0) {
          ans *= a;
        }
      } else {
        a++;
        count = 0;
      }
    }
    cout << ans << endl;
  }
}
void ys() { cout << "Yes" << endl; }
void yb() { cout << "YES" << endl; }
void ns() { cout << "No" << endl; }
void nb() { cout << "NO" << endl; }
void solve() {
  long long n, m;
  cin >> n >> m;
  bool a[m];
  for (int(i) = (0); (i) < (m); (i)++) a[i] = false;
  long long tmp;
  for (int(i) = (0); (i) < (m); (i)++) {
    cin >> tmp;
    a[tmp] = true;
  }
  long long dp[n + 1];
  for (int(i) = (0); (i) < (n + 1); (i)++) dp[i] = 0;
  dp[0] = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < min(n, i + 2) + 1; j++) {
      if (!a[j]) {
        dp[j] += dp[i];
        dp[j] %= 1000000007;
      }
    }
  }
  cout << dp[n] << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
