#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
template <class T, class C>
void chmax(T& a, C b) {
  a > b ?: a = b;
}
template <class T, class C>
void chmin(T& a, C b) {
  a < b ?: a = b;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m, ans = 1;
  cin >> n >> m;
  vector<int> oka(n + 2, true);
  int a;
  for (int i = 0; i < m; i++) {
    cin >> a;
    oka[a] = false;
  }
  vector<long long> d(n + 2, 0);
  d[0] = 1;
  for (int i = 0; i < n; i++) {
    if (oka[i + 1]) {
      d[i + 1] += d[i];
    }
    if (oka[i + 2]) {
      d[i + 2] += d[i];
    }
  }
  cout << d[n] % 1000000007 << endl;
}
