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