#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;
}
const long long INF = 1LL << 60;
int main() {
  int n, m;
  cin >> n >> m;
  int a;
  vector<int> oks(n + 1, true);
  vector<long long int> dp(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> a;
    oks[a] = false;
  }
  dp[0] = 1;
  for (int now = 0; now < n; ++now) {
    for (int next = now + 1; next <= min(n, now + 2); ++next) {
      if (oks[next]) {
        dp[next] += dp[now];
      }
    }
  }
  cout << dp[n] % 1000000007;
  return 0;
}
