#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n, 0);
  for (int i = 0; i < m; i++) {
    int k;
    cin >> k;
    a.at(k) = 1;
  }
  const long long mod = 1000000007;
  vector<long long> dp(n);
  dp.at(0) = 1;
  if (!a.at(1)) dp.at(1) = 1;
  for (int i = 2; i < n; i++) {
    if (a.at(i)) {
      dp.at(i) = 0;
      continue;
    }
    dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % mod;
  }
  long long ans = (dp.at(n - 1) + dp.at(n - 2)) % mod;
  cout << ans << endl;
}
