#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1000000007;
long long func(int lastN, int step, const vector<bool>& a,
               vector<vector<long long>>& memo) {
  if (lastN == step) {
    return 1;
  }
  if (lastN < 0) {
    return 0;
  }
  if (a[lastN]) {
    return 0;
  }
  if (memo[lastN - 1][step - 1] != -1) {
    return memo[lastN - 1][step - 1];
  }
  memo[lastN - 1][step - 1] =
      (func(lastN - step, 1, a, memo) + func(lastN - step, 2, a, memo)) % MOD;
  return memo[lastN - 1][step - 1];
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<bool> a(N, false);
  for (int i = 0; i < M; i++) {
    int ai;
    cin >> ai;
    a[N - ai] = true;
  }
  vector<vector<long long>> memo(N, vector<long long>(2, -1));
  long long ans = (func(N, 1, a, memo) + func(N, 2, a, memo)) % MOD;
  cout << ans << endl;
  return 0;
}
