#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
struct Edge {
  long long to;
  long long cost;
};
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> dp(1001);
  unordered_map<int, int> dest{};
  vector<long long> a(M);
  for (int i = 0; i < (int)(M); i++) {
    cin >> a[i];
    dest[a[i]]++;
  }
  for (int i = 0; i < (int)(dp.size()); i++) dp[i] = 0;
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (dest[i] != 0) continue;
    if (dest[i + 1] == 0) {
      dp[i + 1] += dp[i];
      dp[i + 1] %= MOD;
    }
    if (dest[i + 2] == 0) {
      dp[i + 2] += dp[i];
      dp[i + 2] %= MOD;
    }
  }
  cout << dp[N] << endl;
}
