#include <bits/stdc++.h>
using namespace std;
constexpr int kMod = 1000000007;
template <typename T>
istream& operator>>(istream& is, vector<T>& vs) {
  for (T& v : vs) is >> v;
  return is;
}
long long add(long long a, long long b) { return (a + b) % kMod; }
int main() {
  int N, M;
  cin >> N >> M;
  set<int> A;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    A.insert(a);
  }
  vector<long long> dp(N + 1);
  dp[0] = 1;
  dp[1] = (A.count(1)) ? 0 : 1;
  for (int i = 2; i <= N; ++i) {
    if (A.count(i)) {
      dp[i] = 0;
    } else {
      dp[i] = add(dp[i - 2], dp[i - 1]);
    }
  }
  cout << dp[N] << endl;
}
