#include <bits/stdc++.h>
using namespace std;
int N, M;
int a[100001];
long long MOD = 1e9 + 7;
long long ans[10001];
map<int, int> m;
int main() {
  cin >> N >> M;
  for (int i = 0; i < (M); i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  ans[0] = 1;
  if (m.count(1) == 0) {
    ans[1] = 1;
  }
  for (int i = 0; i < (N + 1); i++) {
    if (i == 0) continue;
    if (i == 1) continue;
    if (m.count(i) == 0) {
      ans[i] = ans[i - 1] + ans[i - 2];
      ans[i] %= MOD;
    }
  }
  cout << ans[N] << endl;
  return 0;
}
