#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using ll = long long;
const ll MOD = 1e9 + 7;
int INF = INT_MAX;
ll LLINF = 1LL << 60;
const vector<int> d8x = {1, 0, -1, 0, 1, -1, -1, 1};
vector<int> d8y = {0, 1, 0, -1, 1, 1, -1, -1};
const vector<int> d4x = {1, 0, -1, 0};
vector<int> d4y = {0, 1, 0, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> broken(n, false);
  for (int i = 0; i < (int)(m); i++) {
    int a;
    cin >> a;
    broken[a - 1] = true;
  }
  vector<ll> ways(n, 0);
  for (int i = 0; i < (int)(n); i++) {
    if (i == 0) {
      if (broken[0] == false) ways[0] = 1;
      continue;
    }
    if (i == 1) {
      if (broken[1] == false) ways[1] = 1;
      ways[1] += ways[0];
      continue;
    }
    if (broken[i] == false) {
      ways[i] = (ways[i - 1] % MOD + ways[i] % MOD) % MOD;
      ways[i] = (ways[i - 2] % MOD + ways[i] % MOD) % MOD;
    }
  }
  cout << ways[n - 1] % MOD << endl;
}
