#include <bits/stdc++.h>
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 LLINF = 1LL << 60;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int m, n, i;
  cin >> n >> m;
  vector<long long int> a(m, 0);
  for (i = 0; i < m; i++) cin >> a[i];
  vector<long long int> dp(n, 0);
  dp[0] = 0;
  dp[1] = 1;
  dp[2] = 2;
  for (i = 0; i < m; i++) dp[a[i]] = -1;
  for (i = 1; i < n + 10; i++) {
    if (dp[i] == -1)
      dp[i] = 0;
    else if (i == 2 && dp[1] == 0)
      dp[2] = 1;
    else {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= 1000000007;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
