#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;
void dfs(int stair, int max) {
  if (stair > max) return;
  for (int i = (1); i < (3); ++i) {
    if (stair + i == max) {
      ans = (ans + 1) % MOD;
      return;
    }
    if (safe[stair + i] == true) dfs(stair + i, max);
  }
}
void solve() {
  cin >> N >> M;
  for (int i = (0); i < (N + 1); ++i) {
    safe[i] = true;
  }
  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;
  dfs(0, N);
  cout << ans << endl;
}
int main(void) {
  solve();
  return 0;
}
