#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
int x[10005];
int ans[10005];
int main() {
  int n, m;
  cin >> n >> m;
  int p;
  memset(x, 0, sizeof(x));
  memset(ans, 0, sizeof(ans));
  ans[0] = 1;
  ans[1] = 1;
  for (int i = 0; i < m; i++) {
    cin >> p;
    x[p] = 1;
    ans[p] = 0;
  }
  for (int i = 2; i <= n; i++) {
    if (!x[i]) {
      ans[i] = ((ans[i - 1] % MOD) + (ans[i - 2] % MOD)) % MOD;
    }
  }
  cout << ans[n] << endl;
  return 0;
}
