#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long> dp(n + 10);
  dp[0] = 1;
  if (a[0] != 1) {
    dp[1] = 1;
  }
  for (long long i = 2; i <= n; i++) {
    if (find(a.begin(), a.end(), i) == a.end()) {
      dp[i] = dp[i - 2] + dp[i - 1];
      dp[i] %= (long long)(1e9 + 7);
    }
  }
  cout << dp[n] << endl;
  return 0;
}
