#include <bits/stdc++.h>
using namespace std;
long long MOD = (int)1e9 + 7;
long long N;
vector<long long> DP;
vector<bool> steps;
long long func(long long n) {
  if (n >= N) return 1;
  if (DP[n] != -1) return DP[n];
  if (steps[n + 1] and steps[n + 2]) {
    return DP[n] = 0;
  } else if (steps[n + 1]) {
    return DP[n] = (func(n + 2) % MOD);
  } else if (steps[n + 2]) {
    return DP[n] = (func(n + 1) % MOD);
  } else {
    return DP[n] = ((func(n + 1) + func(n + 2)) % MOD);
  }
}
int main() {
  int m;
  cin >> N >> m;
  DP.assign(N + 1, -1);
  steps.assign(N + 2, false);
  for (int i = 0; i < (int)m; i++) {
    int t;
    cin >> t;
    steps[t] = true;
  }
  cout << func(0) << endl;
}
