#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int MOD = 1000000007;
vector<long long> dx = {0, 1, 0, -1};
vector<long long> dy = {1, 0, -1, 0};
vector<long long> dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
vector<long long> dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};
struct InitIO {
  InitIO() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(30);
  }
} init_io;
int main(int argc, char const* argv[]) {
  int n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long> dp(n + 1, 0);
  if (a[0] != 0) {
    dp[0] = 1;
  }
  if (!binary_search((a).begin(), (a).end(), 1)) {
    dp[1] = 1;
  }
  if (n == 1) {
    cout << dp[1] << endl;
    return 0;
  }
  for (int i = 2; i < n + 1; i++) {
    if (!binary_search((a).begin(), (a).end(), i)) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= MOD;
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
