#include <bits/stdc++.h>
using namespace std;
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  long long a[100010];
  for (int i = 0; i < (M); ++i) cin >> a[i];
  long long dp[100010];
  for (int i = 0; i < (100010); ++i) {
    dp[i] = INF;
  }
  for (int i = 0; i < (M); ++i) {
    dp[a[i]] = 0;
  }
  dp[0] = 1;
  for (int i = 1; i < (N + 1); ++i) {
    if (i > 1) {
      if (dp[i] != 0) {
        dp[i] = dp[i - 1] + dp[i - 2];
      }
    } else
      dp[i] = dp[i - 1];
  }
  cout << dp[N] % 1000000007 << endl;
  return 0;
}
