#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bitset<100000> judge;
ll MOD = 1000000007;
ll time(ll k) {
  if (k == 1) {
    return (judge.test(k)) ? 1 : 0;
  }
  if (k == 2) {
    return (judge.test(k)) ? time(1) + 1 : 0;
  }
  return (judge.test(k)) ? time(k - 1) % MOD + time(k - 2) % MOD : 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  judge.set();
  for (int i = 0; i < (int)(m); i++) {
    int a;
    cin >> a;
    judge.set(a, 0);
  }
  ll ans = time(n);
  cout << ans << endl;
}
