#include <bits/stdc++.h>
using namespace std;
const long long mod = long long(1e9 + 7);
void fastik() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
void solve() {}
int main() {
  fastik();
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (int i = 0; i < (int)(m); ++i) cin >> a[i];
  vector<long long> d(n, -1);
  d[0] = 1;
  for (int i = 0; i < (int)(m); ++i) {
    d[a[i] - 1] = 0;
  }
  d[1] = d[0] + 1;
  for (int i = (int)(2); i <= (int)(n - 1); ++i) {
    if (d[i] == 0) {
      continue;
    }
    d[i] = (d[i - 1] + d[i - 2]) % mod;
  }
  cout << d[n - 1] % mod;
}
