#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (M); i++) cin >> a[i];
  vector<long long> ans(N + 1);
  ans[0] = 1;
  if (binary_search((a).begin(), (a).end(), 1))
    ans[1] = 0;
  else
    ans[1] = 1;
  for (int i = 2; i < N + 1; i++) {
    if (binary_search((a).begin(), (a).end(), i))
      ans[i] = 0;
    else
      ans[i] = ans[i - 1] + ans[i - 2];
  }
  cout << ans[N] % 1000000007 << endl;
}
