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