#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int INF = 1001001001;
const int mINF = -1001001001;
const int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); i++) cin >> a[i];
  sort((a).begin(), (a).end());
  long long ans[n + 1];
  ans[0] = 1;
  long long j = 0;
  for (long long i = 1; i <= n; i++) {
    if (i == a[j]) {
      ans[i] = 0;
      j++;
    } else if (i == 1) {
      ans[i] = ans[i - 1];
    } else {
      ans[i] = ans[i - 1] + ans[i - 2];
    }
    ans[i] %= mod;
  }
  cout << ans[n] << endl;
  return 0;
}
