#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  set<int> a;
  for (int i = 0; i < (int)(M); i++) {
    int x;
    cin >> x;
    a.insert(x);
  }
  vector<uint64_t> dp(N + 1);
  dp[0] = 1;
  if (!(a.count(1))) dp[1] = 1;
  int i = 2;
  for (int i = 2; i <= N; i++) {
    if (!(a.count(i))) {
      if (a.count(i - 1) && a.count(i - 2)) {
        cout << 0 << endl;
        return 0;
      } else if (a.count(i - 1)) {
        dp[i] = dp[i - 2];
      } else if (a.count(i - 2)) {
        dp[i] = dp[i - 1];
      } else
        dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  uint64_t y = pow(10, 9) + 7;
  cout << dp[N] % y << endl;
  return 0;
}
