#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 1;
const long long MOD = 1e9 + 7;
int gcd(int a, int b) {
  if (a < b) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
int s2i(string num) {
  stringstream ss;
  ss << num << flush;
  int n;
  ss >> n;
  return n;
}
string i2s(int n) {
  stringstream ss;
  ss << n << flush;
  return ss.str();
}
bool firstCompare(const pair<int, int>& firstElof,
                  const pair<int, int>& secondElof) {
  return firstElof.first < secondElof.first;
}
bool secondCompare(const pair<int, int>& firstElof,
                   const pair<int, int>& secondElof) {
  return firstElof.second < secondElof.second;
}
long long N, M;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) cin >> a[i];
  vector<long long> f(N + 1);
  f[0] = 1;
  long long idx = 0;
  for (long long i = 1; i < N + 1; i++) {
    if (idx <= M && a[idx] == i) {
      f[i] = 0;
      idx += 1;
    } else if (i == 1) {
      f[i] = 1;
    } else {
      f[i] = (f[i - 1] + f[i - 2]) % MOD;
    }
  }
  cout << f[N] << '\n';
}
