#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const int MAX_N = 1e+5, MAX_M = 1e+5;
const int MOD = 1000000007;
int N, M;
int a[MAX_N + 1];
bool safe[MAX_N + 1];
long long ans;
long long memo[MAX_N + 1];
long long dfs(int stair, int max) {
  long long ans = 0;
  long long tmp = 0;
  if (stair > max)
    return 0;
  else if (stair == max)
    return 1;
  if (safe[stair] == false) return 0;
  for (int i = 1; i <= 2; i++) {
    if (safe[stair + i] == true) {
      if (memo[stair + i] != 0) {
        ans = (ans + memo[stair + i]) % MOD;
      } else {
        memo[stair + i] = dfs(stair + i, max);
        ans = (ans + memo[stair + i]) % MOD;
      }
    }
  }
  return ans;
}
void solve() {
  cin >> N >> M;
  for (int i = (0); i < (N + 1); ++i) {
    safe[i] = true;
    memo[i] = 0;
  }
  for (int i = (0); i < (M); ++i) {
    cin >> a[i];
    safe[a[i]] = false;
  }
  sort(a, a + N, [](const int& x, const int& y) { return x < y; });
  for (int i = (0); i < (M - 1); ++i) {
    if (a[i + 1] - a[i] == 1) {
      cout << "0" << endl;
      return;
    }
  }
  ans = 0;
  cout << dfs(0, N) << endl;
}
int main(void) {
  solve();
  return 0;
}
