#include <bits/stdc++.h>
using namespace std;
const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
  if (ci - cn == cm) {
    fread_unlocked(cn, 1, cm, stdin);
    ci = cn;
  }
  return *ci++;
}
inline int getint() {
  int A = 0;
  if (ci - cn + 16 > cm)
    while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
  else
    while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
  return A;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N = getint(), M = getint();
  if (M > N / 2)
    cout << (0) << "\n";
  else {
    int A[100001];
    for (int i = 0; i < (M); i++) {
      int a = getint();
      A[a] = 1;
    }
    long long dp[100002];
    dp[0] = 0;
    dp[1] = 1;
    long long mod = 1e9 + 7;
    int meyasu = 0;
    for (int i = 1; i <= (N); i++) {
      if (A[i] != 1) {
        dp[i + 1] = dp[i] + dp[i - 1];
        meyasu++;
        if (meyasu >= 30) {
          dp[i] %= mod;
          dp[i + 1] %= mod;
          meyasu = 0;
        }
      }
    }
    cout << (dp[N + 1] % mod) << "\n";
  }
  return 0;
}
