#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  vector<bool> judge(m, true);
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    judge[a[i]] = false;
  }
  vector<long long> f(n + 1);
  f[0] = 1;
  f[1] = 1;
  long long next = 0;
  if (a[0] == 1) {
    f[1] = 0;
    if (next < m - 1) next++;
  }
  for (long long i = 2; i <= n; i++) {
    f[i] = f[i - 1] + f[i - 2];
    if (a[next] == i) {
      f[i] = 0;
      if (next < m - 1) next++;
    }
    f[i] %= 1000000007;
  }
  cout << f[n] << endl;
  return 0;
}
