#include <bits/stdc++.h>
using namespace std;
long long dp[1000000];
long long MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  long long ans;
  bool f = true;
  vector<int> v(M);
  for (int i = 0; i < M; i++) {
    cin >> v[i];
    if (i >= 1 and abs(v[i]) - abs(v[i - 1]) == 1) {
      ans = 0;
      f = false;
    }
  }
  dp[0] = 1;
  if (f) {
    for (int i = 1; i <= N; i++) {
      auto result = std::find(v.begin(), v.end(), i);
      if (result != v.end()) {
        dp[i] = 0;
      } else {
        dp[i] = dp[i - 1] + dp[i - 2];
        ans = dp[i] % MOD;
      }
    }
  }
  cout << ans % MOD << endl;
}
